How to get this codes that are inside a parent tag. For example:
<div class="main">
<p>This is a sample photo <img src="sample.jpg" /></>
</div>
How to get all the contents that is inside <div class="main">, this also includes the attributes etc.? This code,<p>This is a sample photo <img src="sample.jpg" /></> , and place it inside a variable?
Thanks.
Should do it
This will return the innerHtml of the first element found with a class of
main.