Javascript examples for DOM Event:preventDefault
Event.PreventDefault to stop event bubble
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.js"></script> <script type="text/javascript"> $(window).load(function(){/*w w w . j av a 2 s. co m*/ $("input[type='checkbox']").on('mousedown',function(evt) { evt.preventDefault(); console.log(this.checked); }); }); </script> </head> <body> <input type="checkbox"> <br> <input type="checkbox" checked> </body> </html>