Thursday, February 21, 2013

Alert JS loss focuss on browser tab

Alert JS loss focus on browser tab


You may have seen alert massages appear in browsers when you change from one tab to another this is done by Java script on blur function.This example shows you following alert box


 Create HTML page using  Following code to generate above alert

<script type="text/javascript">
window.onblur = function () {

    alert('loss of focus on this tab,you will not get any point');
}
</script>
<h1>Loss of Focus JS</h1>