html代码:
|
1
|
<button id = "new" onclick="showme()"></button>
|
jquery代码:
|
1
|
function showme(){ console.log($(this).attr('id')); }
|
未经允许不得转载:主机阁 » JQuery获得当前元素id
html代码:
|
1
|
<button id = "new" onclick="showme()"></button>
|
jquery代码:
|
1
|
function showme(){ console.log($(this).attr('id')); }
|