Reputation: 125
I have an HTML element like this:
<div id="new"></div>
I want to append a onmouseover function to append text to this element like this:
<div id="new" onmouseover="show_pop()"></div>
What is the jQuery function for this?
Upvotes: 0
Views: 3142
Reputation: 1166
You want:
$('#new').mouseover(function() {show_popup();});
Or, if you REALLY want it to actually add that to the node (which you probably don't), then something like:
$('#new').attr('onmouseover', 'show_popup()');
Upvotes: 1