Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
34
rated 0 times [  38] [ 4]  / answers: 1 / hits: 42331  / 14 Years ago, sat, june 12, 2010, 12:00:00

How do I get the values in between a DIV tag?



Example



<div id=myOutput class=wmd-output>
<pre><code><p>hello world!</p></code></pre>
</div>


my output values I should get is



<pre><code><p>hello world!</p></pre>

More From » javascript

 Answers
22

First, find the element. The fastest way is by ID. Next, use innerHTML to get the HTML content of the element.



document.getElementById('myOutput').innerHTML;

[#96524] Wednesday, June 9, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alejandro

Total Points: 231
Total Questions: 102
Total Answers: 107

Location: Jordan
Member since Wed, Jun 17, 2020
4 Years ago
;