How to set HTML of any control using jQuery
<div id="dvExample">
<h1>
jQuery By Example Rocks..
</h1>
<h2>
It has really cool tips.
</h2>
</div>
Below jQuery code will set the div content and display the new content. I will remove h1 and h2 tag and will place h3 tag.
$(document).ready(function()
{
$("#dvExample").html('<h3>I am new content of the div.</h3>')
console.log($("#dvExample").html());
});
<div id="dvExample">
<h1>
jQuery By Example Rocks..
</h1>
<h2>
It has really cool tips.
</h2>
</div>
Below jQuery code will set the div content and display the new content. I will remove h1 and h2 tag and will place h3 tag.
$(document).ready(function()
{
$("#dvExample").html('<h3>I am new content of the div.</h3>')
console.log($("#dvExample").html());
});
0 comments:
Post a Comment