Hi,

Actually my requirement is when i move my mouse on the link, One alert box shoulb be appear and it will count how many times i move on that link. I already written the code in javascript but it didn't reach to my requirement. Please go through the below code and do needful.


<html>
<head>
<title>
Event Handler with multiple statement</title>
<script language="javascript">
count=0
</script>
</head>
<body>
<h1>Evet Handler with multiple statements</h1>
<p><a href="https://imailhyd.satyam.com\owa" ONMOUSEOVER="++count; 
"alert('You moved mouse here "++count+" times!')">
Displays the number of times you move your mouse over the link.
</a>
</p>
</body>
</html>

Thanks & Regards,

Jayavardhan.Tummidi

Recommended Answers

Solution:

<html>
<head>
<title>
Event Handler with multiple statement</title>
<script language="javascript">
function cnt()
{
	var count=parseInt(document.frm1.inp1.value);
	count++;
	document.frm1.inp1.value=count;
	alert(document.frm1.inp1.value);
}
</script>
</head>
<body>
<form name="frm1" method="post" action="">
<h1>Evet Handler with multiple statements</h1>
<p><a href="
Jump to Post

All 3 Replies

Member Avatar

Solution:

<html>
<head>
<title>
Event Handler with multiple statement</title>
<script language="javascript">
function cnt()
{
	var count=parseInt(document.frm1.inp1.value);
	count++;
	document.frm1.inp1.value=count;
	alert(document.frm1.inp1.value);
}
</script>
</head>
<body>
<form name="frm1" method="post" action="">
<h1>Evet Handler with multiple statements</h1>
<p><a href="https://imailhyd.satyam.com\owa" ONMOUSEOVER="cnt()">Displays the number of times you move your mouse over the link.</a></p>
<input type="hidden" name="inp1" value="0"/>
</form>
</body>
</html>

I have tested and works fine.

Thank you RajaRajan.

Member Avatar

Please Mark the thread as solved. if it is solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.