0

I have the following div:

<div id="mydiv">something</div>

I need to get the content of the div (mydiv) and put it into a JavaScript variable. How can i do it?

Richard Ev
  • 51,030
  • 56
  • 187
  • 275

1 Answers1

5
var content = document.getElementById("mydiv").innerHTML;
tymeJV
  • 102,126
  • 13
  • 159
  • 155