To pass the ID of DIV tag in JQuery
- by kwokwai
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.