I have this:
<img border="0" onmouseout="hidetips();" onmouseover="showtips();" src="image.gif">
<script type="text/javascript">
$(document).ready(function() {
$("img").each(function(index){
$(this).attr("onmouseout", "hidetips();newfunction();");
});
});
</script>
I tried above but it is not working, anyone one know how to add extra newfunction() at behind on the onmouseout attribute?
Use the
mouseoutmethod to bind an event handler. Use an anonymous function to contain calls to the separate functions:Note: It will bind all found elements in the jQuery object, so you don’t have to loop.
Edit:
You can bind the
showtipsfunction using jQuery also, so that you don’t need the event attributes in every image element: