我正在尝试从子 div 修改父 div 中的文本而不更改子 div 内容。
我有
<div id='testDiv'>
this is the test parent div
<div id='child1'>
lots of contents and child div
...................
</div>
more div/child div and contents...
</div>
在我的jQuery中
$('child1 div a').click(function(){
$('#testDiv').text('new text'); //this will remove the child1 div and all the contents inside testDiv
//I want to replace 'this is the test parent div' text to 'newt text'
})
有没有办法完成这件事?非常感谢!