Disable F5 Key (keyboard button) and browser refresh using Body Tag.

Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 460
We have 116 i.e. ASCII key code of Keyboard F5 function key then stop its propagation by returning false inside the event handler.

We need to define the onkeydown event handler within the body tag and simply return false if the pressed key is F5 function key i.e. ASCII key code 116.
<body onkeydown = "return(event.keyCode != 116);">    

Comments or Responses

Login to post response