I want to change the placeholder text of a asp:TextBox at run time.
please suggest me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Jun 30, 2015, 11:59 PM
you can use
getElementsByName()method to select theinputfields and to change theplaceholderfor 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';
SharadPosted Jun 30, 2015, 11:59 PM
getElementsByName()method to select theinputfields and to change theplaceholderfor each one... see the below code...If you wanted to replace all placeholder text from whole site. add below code in your js file, this will change