Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Find currenly which field is having focus on html page?

Ads

 
 

Share on Google+Share on Google+

Navnath
Find currenly which field is having focus on html page?
1 Answer(s)      8 years ago
Posted in : Ajax
Ads
View Answers

July 6, 2009 at 5:03 PM


Hi Friend,

Try the following code:

<html>
<head>
<script>
function whichBlur(f){
alert(f)}
</script>
</head>
<body>
<form name=Form1 method="post">
<input name="Form1" type="submit" value="Form1" onfocus="whichBlur(this.name)">
</form>
<form name=Form2 method="post">
<input name="Form2" type="submit" value="From2" onfocus="whichBlur(this.name)">
</form>
</body>
</html>

Thanks

Ads