How to set timer using java script.?

Ranjeet_8
Posted by Ranjeet_8 under JavaScript category on | Points: 40 | Views : 1708
Set timer using java script

//Java Script
    <script language="javascript" type="text/javascript">

window.setTimeout("HideDiv()", 15000); //Hide Div after 15 seconds
function HideDiv() {

document.getElementById('Layer2').style.display = "none";
}

</script>


// HTML
<div id="Layer2" >
Sample Text Here
</div>

Comments or Responses

Login to post response