<div class="testcaselist_row"><ul><li id="tc_1" class="clickTestCaseRow"><a href="#" style="color: #ffffff!important;">q</a><a class="delete deleteTestCase_h"></a><button class="edit_h" href="#">Edit</button></li></ul></div>
您能否告诉我如何在编辑按钮上找到锚标记文本?
$(document).on('click','.edit_h',function(e){
alert('rdit'+$(this).closest('li').attr('id'));//getting iD
alert($(this).closest('a').text()); //getting undefined it shouted be "q"
$("#editTestCaseId").popup("open");
e.stopPropagation();
e.stopImmediatePropagation();
});
答案 0 :(得分:0)
答案 1 :(得分:0)
试试这个
$(document).on('click','.edit_h', function(){
alert( $(this).closest("li").find("a:eq(0)").text());
});