I am try to change non input attribute value in Firefox frame in the format:

 <div id='100' class='abc'>
<p> hello </p>
<div id='200' class='abc'>
<p> hello 2 </p>

I want to change hello 2 to welcome I try this code but it does not work


Your locator would fetch the first div, of id = 100.

Try the following:

document.querySelector('#200 p').innerText='welcome';
| improve this answer | |
  • thanks it works , – mtesta010 Jun 15 '19 at 11:46
  • what if I want to use class name 'abc'?? – mtesta010 Jun 15 '19 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.