Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <p id="text"> Lorem ipsum dolor sit amet. </p>
- </body>
- <script>
- document.onkeydown = KeyCheck; //or however you are calling your method
- function KeyCheck()
- {
- var KeyID = event.keyCode;
- switch(KeyID) {
- case 8:
- var textbox = document.getElementById("text");
- var value = textbox.innerHTML;
- textbox.innerHTML = value.substring(0, value.length - 1);
- break;
- default:
- break;
- }
- }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement