Если я нажму #parent
, я хочу вернуть текст внутри него, а не вернуть текст внутри вложенного
слои (#child-parent
, #child
)
<div id='parent'>
this text is for parent
<div id='child-parent'>
this text if for child-parent
<div id='child'>
and this text is for child.
</div>
</div>
</div>
это:
$('#parent').html() = "this text is for parent"
а не это:
$('#parent').html() = "this text is for parent this text is for child-parent and this text is for child"