Jump to content

Replace some string with different strings in javascript


rahultailwal

Recommended Posts

Hi all, The scenario of my problem is to replace some sting from a textarea where some default text is written. Suppose i have a word phone no is written there when i first come to that page. Now i have a textbox where i can put any phone no and a button to submit. After submitting phone no the phone no text will be replaced in textarea. Now the problem is suppose he do mistake of filling wrong phone no. so he will again write phone no in textbox but i have replaced all phone no word with given phone no so how can i make it working again. it will work only once. Hope you understand what i want to do. Thanks

Link to comment
Share on other sites

Your question is confusing, but if you need to change your text with JS, target using innerHTML. http://www.w3schools...l_innerhtml.asp Post some code to get a more specific answer.

Edited by niche
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...