[jQuery] Using selectors successfully...?
Will someone please explain to me why the following code fails to
execute? I have a simple test page set up and jquery doesn't seem
happy with what I'm trying to do. I get no errors, and when I log to
console in firebug it shows that it is indeed finding my two objects,
however it won't actually perform 'addClass':
$(document).ready(function() {
$(".testclass").each(function(){
$(this).addClass("midget");
});
});
At first I just figured it was because I wasn't doing an "each", but
then after trying each and having it still fail, I was back to square
one. Also, is it not possible to select based on tags (e.g.
'div.divclass')?
Any help would be much appreciated.
Best!