I want to set value of a tag with document model
I need to set changeme value to something
How can i do that no jquery please
<a href="">changeme</a>
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need first to get a reference to the DOM element. There are numerous ways of doing this (the easiest is probably
getElementById, so use that if you can give your link anid). If not, you could usegetElementsByTagName:Once you have a reference to the element, you can change the text using the
textContentproperty. Unfortunately, it’s not quite that simple, because IE usesinnerTextrather thantextContent: