skip to Main Content

I Want To Change The value For the <div role="textbox"> Using JS

I Tried :

let element = document.getElementById('ElementID');
element.value += 'AnyTextWithEmoji';

But The Value Doesn’t Change

I Wan’t To Change This Element Value Using Java Script

2

Answers


  1. You need to use element.innerHTML = "AnyTextWithEmoji"

    There are some other attributes you can use like textContent or innerText you can find more info here: https://www.w3schools.com/jsref/prop_html_innerhtml.asp

    Login or Signup to reply.
  2. you can try using innerText property instead of value

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search