I’ve got this:
<h1 id="test" class="test">
and in a script part this:
alert($('#test').id)
alert($('.test').id)
jQuery is definitely loaded. But I get undefined in the alert box – both times. If I use the regular getElementById, it works and shows test.
What the heck is wrong (with me)
here’s an example http://jsfiddle.net/tF6bd/
change:
to:
or:
for jQuery objects you should use
attr()method.