I tested this code snippet but the first function is not executing while the second one does.Why is this? The same function works fine on hover event..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.6.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").mouseover(function(){
$(".Stop").text($(".Stop").text()+" Test 0");
},function(){
$(".Stop").text($(".Stop").text()+" Test 1");
}
);
})
</script>
<style type="text/css">
.Stop{color:red;border:#000 thin solid;width:100px;}
</style>
<title>Untitled Document</title>
</head>
<body>
<form name="frm1" >
<input type="text" id="myForm"/>
<input type="text" id="myForm1"/>
<input type="text" id="myForm2"/>
</form>
<p class="sakl" >Click</p>
<p class="Stop"></p>
</body>
</html>
Nowhere in the jQuery documentation for
mouseoverdoes it specify that two functions can be used with it. You’ll have to usehoverfor this, which does much the same job.