Reputation: 1
$('#somediv').html(' <div id="innerDiv"> Testing </div>');
From the above statement I am setting the html for #somediv as
<div id="innerDiv"> Testing </div>
I want now to select innnerDiv. How do I do it??
eg: $('#innnerDiv').html("Modified");
Upvotes: 0
Views: 53
Reputation: 2241
what ever you have stated $('#innnerDiv').html("Modified"); is the correct way to access the #innerdiv and modify its content
Upvotes: 0
Reputation: 43850
Just the way you did it, once the html is on the DOM you can select it
$('#innnerDiv')
if you want the html inside, you can use:
var htmlStr = $('#innnerDiv').html();
// in your case it will contain: Testing
Upvotes: 1