This post will help you to fetch the value from any input tag in the FORM Element.
The below code fetches the value of the text field when submit button is clicked and displays an JS alert counting the number of characters of the input string.
alert("Your name is "+nam+" and it has "+nam.length+" Chars");
<input type="text" placeholder="Enter your name!" id="myText"/><br/><br/>
<input type="submit" value="Submit">
Found any suggestions ?
Comment them here !
Latest posts by Bikash Panda (see all)
- OSMC on Raspberry PI with Setup and Control using Android App - July 7, 2017
- DHT12 Interfacing with Raspberry Pi using Pi4J - June 19, 2017
- Send data using MQTT from Raspberry Pi with JAVA - June 12, 2017