Hi All, I have one html structure , somethinh like
<div>
<div id="mydiv">
<h3>
This is a Test Page
</h3>
<div>I am inside a div</div>
<a href="http://www.google.com">Click me</a>
<div>Second div</div>
</div>
</div>
and one script:
$(function () {
var elm = document.getElementById("mydiv").innerHTML;// can use html()of jquery
alert(elm);
});
Now elm prints/alerts below code:
<h3>
This is a Test Page
</h3>
<div>I am inside a div</div>
<a href="http://www.google.com">Click me</a>
<div>Second div</div>
now my question is what are the ways to get value/access "h3"/"a"
tags from var elm. Note: I want to use elm.[I know this can easily be done by
$("#mydiv h3")]
so just want to use var elm....the sln can be both in jQuery/javascript.