Change placeholder text

If you wanna use Javascript then you can use getElementsByName() method to select the input fields and to change the placeholder for each one… see the below code…

document.getElementsByName('Email')[0].placeholder="new text for email";
document.getElementsByName('First Name')[0].placeholder="new text for fname";
document.getElementsByName('Last Name')[0].placeholder="new text for lname";

Otherwise use jQuery:

$('input:text').attr('placeholder','Some New Text');

Leave a Comment