html - How to get div and full inner content in javascript? -
i want div inner content in javascript
ex:
<div id="content" style="height: 20px; overflow: hidden"> content<br>content<br>content<br> </div>
this html code. know div id (content). want retrieved main div , inner content via javascript like..
<div id="content" style="height: 20px; overflow: hidden"> content<br>content<br>content<br> </div>
also want retrieved content div attribute style, class name etc.
use getelementbyid()
element , innerhtml
tht content
document.getelementbyid('content').innerhtml;
to content of whole tag , use outerhtml
document.getelementbyid('content').outerhtml;
Comments
Post a Comment