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
  • 52,939
  • 59
  • 191
  • 278

1 Answers1

5
var content = document.getElementById("mydiv").innerHTML;
tymeJV
  • 103,943
  • 14
  • 161
  • 157