Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

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).



$('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();




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: