I have below script which shows values from search page onmouseover
.
<script type="text/javascript">
function preview(val) {
$.ajax({
type: "POST",
url: "search.php",
data:'id='+val,
success: function(data){
$(".ress").html(data);
}
});
}
</script>
html :
<div class="CVSearchResult" onmouseover="preview('1')">
search :
<?php echo $_POST['id']; ?>
output for class .ress :
1
However I want to hide the output onmouseout
as well. How can I do this? I mean just trigger the AJAX for mouse hover and hide if not hover.