How can I change the placeholder text of an input element?
For example I have 3 inputs of type text.
<input type="text" name="Email" placeholder="Some Text">
<input type="text" name="First Name" placeholder="Some Text">
<input type="text" name="Last Name"placeholder="Some Text">
How can I change the Some Text text using JavaScript or jQuery?
If you wanna use Javascript then you can use
getElementsByName()method to select theinputfields and to change theplaceholderfor each one… see the below code…Otherwise use jQuery: