This is basic.
How do I get the value 'This is my name' of the above span?
<div id='item1'>
<span>This is my name</span>
</div>
This is basic.
How do I get the value 'This is my name' of the above span?
<div id='item1'>
<span>This is my name</span>
</div>
$('#item1 span').text() or $('#item1 span').html()
should do the trick I think
Assuming you intended it to read id="item1", you need
$('#item1 span').text()
$('#item1').text(); or $('#item1').html(); works fine for id="item1"