Javascript examples for DOM HTML Element:Input Text
apply substring to results from input text field
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function subStringIt(){//from ww w .ja va 2 s . c om var wholeStr = document.getElementById("inputString").value; var subStr = wholeStr.substring(1, wholeStr.length); console.log(subStr); } </script> </head> <body> <input type="text" id="inputString"> <input type="button" id="subIt" value="substring it" onclick="subStringIt()"> </body> </html>