How does the following code need to be changed so when the onmouseover event fires up a div appears on the right side of the hyperlink?
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$('a.moreDetails').hover(function() {
$(this).next().toggle('fast');
});
});
</script>
<body>
<a href="#" class="moreDetails">(details)</a>
<div class="details">User 1</div>
</body>
</html>
jQuery’s hover method takes two function inputs:
You also appear to be missing your closing
</head>tag. Getting your element to appear next to your link will require some markup-changes, javascript manipulation, or some css rules. You could make this minor change: