What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-12 05:23:07
javascript trap focus
/** *Function should be called on keyPress or something */ function _focusTrapperEvent(e) { if (!(e.key === 'Tab' || e.keyCode === 9)) return; let condition = 'a[href], area[href], input:not([disabled]):not([type="hidden"]), select:not([... Add solution -
VBA 2021-10-02 01:48:03
move player with keyboard with boundaries vb.net
'Note: before I did the code, I added 2 labels, 4 timers '(names are "tmrRight", "tmrleft", "tmrUp", and "tmrDown") 'and 3 pictureboxes (one of which is named "pbPlayer") 'the 2 labels and 2 pictureboxe... Add solution -
Javascript 2021-10-01 06:02:04
jquery left arrow key press
<html> <head> <title>jQuery Arrow Keys | Bind Arrow Keys using jQuery</title> <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script> </head> <body> Hit the arrows keys on... Add solution -
Other 2021-10-01 02:33:04
how to disable up and down arrow downscroll for a website
var keys = {}; window.addEventListener("keydown", function(e){ keys[e.keyCode] = true; switch(e.keyCode){ case 37: case 39: case 38: case 40: // Arrow keys case 32: e.preventDefault(); break; // Space... Add solution -
Javascript 2021-09-24 14:56:02
onclick enter key
<form> <input id="myInput" placeholder="Some text.." value=""> <input type="submit" id="myBtn" value="Submit"> </form> <script> var input = document.getElem... Add solution -
Javascript 2021-09-24 13:47:03
right click of mouse and block F12 key
Source: https://www.programmingquest.com/2018/08/prevent-right-click-of-mouse-and-block.html For preventing Right click Context menu: $(document).on("contextmenu", function (e) { e.preventDefault(); }); For preventing 'F12' and '... Add solution -
Javascript 2021-09-24 11:22:02
how to press enter key automatically using javascript
<form> <input id="myInput" placeholder="Some text.." value=""> <input type="submit" id="myBtn" value="Submit"> </form> <script> var input = document.getElem... Add solution -
Other 2021-09-22 06:49:02
dont allow user to insert number greater than particular number
function isNumberKey(e) { var currentChar = parseInt(String.fromCharCode(e.keyCode), 10); if(!isNaN(currentChar)){ var nextValue = $("#txthour").val() + currentChar; //It's a string concatenation, not an addition if(pars... Add solution