var e = jQuery.Event("onmouseover");
e.attr("id");
I want to get id of this element but it does not work. e returns object.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think
jQuery.Event, which creates a new event object to be passed around to the elements, does what you want.I think you only want to get the ID of certain elements when the mouse passes over them? If so, and the elements have a common class name, then do:
If they are all of the same tag, e.g.
<p>, then do something like:If you want to do this for all elements on the page (not recommended, usually you can narrow it down):
You may want to read more about jQuery selectors to get to the elements that you want.