This code works fine in <= IE7, but it doesn’t work in firefox .. i am using firefox browser 12.0 .. I am not sure whats the reason .. help would be much appreciated .. thanks ..
<head>
<script type="text/javascript">
function getfocus(obj){
if(obj.value.length==0){
alert("Please enter something");
obj.focus();
}
}
</script>
</head>
<body>
<input type="text" onblur="getfocus(this)" value="Get focus">
</body>
</html>
try: