To pass the ID of DIV tag in JQuery

Posted by kwokwai on Stack Overflow See other posts from Stack Overflow or by kwokwai
Published on 2010-04-28T06:19:56Z Indexed on 2010/04/28 6:23 UTC
Read the original article Hit count: 266

Filed under:

Hi all,

I am learning JQuery. In a HTML file, I got this:

<DIV ID="testing">

And I am trying to pass the ID of this DIV tag to a JQuery self-defined function:

<script>

$(function() { $("div").mouseover(function() { var ID = $(this).children().attr('id'); alert(ID); });

});

But it wont work.

© Stack Overflow or respective owner

Related posts about jQuery