Find currenly which field is having focus on html page?

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









Related Tutorials/Questions & Answers:
Advertisements