-1

I'm trying to learn innerHTML commands, but it's just showing me "Author: " text.

HTML side

  <h1 id="author">Author: </h1>
  <p>Sabir Türkleri'nin ve Batı Göktürk boylarının devamı olan Hazarlar, Göktürk birliği döneminde Göktürklerin Batı kanadını oluşturmaktaydı.</p>
  </body>

JS side

   var content= "Ensar Ergok";
   document.getElementById("author").value=content;
2
  • You haven't said whether you're getting an error, but as you said in the question, it's innerHTML, not value, for an h1 element, see the linked question's answers. If you did get an error message, it'll be because of this. Commented Dec 5, 2021 at 11:21
  • (There has to be a better dupetarget for the value/innerHTML thing though.) Commented Dec 5, 2021 at 11:26

1 Answer 1

0

You need to use innerText, textContent or innerHTML instead of value.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.