0

Can someone please explain why jQuery automatically sets a variable using the ids in a HTML document? I am using jsFiddle to test this behaviour with jQuery 1.11.0

<div id ="hero"></div>  
alert(hero);

This displays the DOM Object.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
koolkoda
  • 365
  • 3
  • 6

0 Answers0