[jquery] Can't get the attribute solution and example of the current label - Qinqin Senior 318692996


<a href="javascript:;" class="btn-del weui_btn weui_btn_primary" id="7" onclick="goDel()">删除</a>


改成

<a href="javascript:;" class="btn-del weui_btn weui_btn_primary" id="7" onclick="goDel.call(this)">删除</a>


来自 https://zhidao.baidu.com/question/716400672423901685.html

example

onclick="sjwtjz.call(this);" value="666"

js part

function sjwtjz()
{
console.log($(this).attr('value'));
}



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326484615&siteId=291194637