I want to show a parameter value when a user mouseover it. I want to do it with jquery. My function is returning an undefined value.
<script type="text/javascript">
$(function showinfo(id, a,b){
$('div').mouseover(function(){
var html= '<div>'+ a +'</div> <div>'+b+'</div>';
$('body').append(html)
})
})
</script>
HTML:
<div onmouseover="showinfo(this, '50','60')">show info</div>
I would suggest to do it slightly differently:
And jQuery:
You can also have a look on hover function of jQuery.
jsFiddle here: http://jsfiddle.net/KvMuD/