如果你有
<div class="expFold" id="i_0"><a href="#">▼</a></div>
和
$(this).attr('id')
点击功能中的为您提供“i_0”,如何使用
定位锚点内的文本$(this)
谢谢你看看。
答案 0 :(得分:2)
使用.text()
:
$(this).find('a').text();
或
$("a", this).text();
<强> Working Demo 强>
设置值:
$("a", this).text('test');
或
$(this).find('a').text('test');
<强> Working Demo 强>