News for hackers. Stuff that matters.
Re:Poll: Suggestions please, which JavaScript library? by hbien on Saturday June 07, 2008 @07:07PM (#211756)
I really like jQuery because it's lightweight but I think it really fits your needs perfectly. For DOM manipulation in jQuery you just use CSS selectors, so... :

    $('a.hide_these').hide();
Would hide all anchors with class 'hide_these'. You don't have to do any iterations or pass any anonymous functions. Traversing works the same way too:

    $('a.hide_these').parents('p')
Would find all the paragraph tags that are parents to those anchors.

I've only used a few animations from jQuery (like sliding/fading) but the framework also lets you do your own custom animations using CSS (your element will gradually morph to the styles you define).

Re:Poll: Suggestions please, which JavaScript library? by jamongkad on Wednesday June 11, 2008 @12:10AM (#214586)
$('a.hide_these').parents('p')

or if you want to hide all the anchors of class hide_these then you could do this.

$('p > a.hide_these').hide();