我想在jquery中更改元素的id,即
$('.aiButton').click(function(){
$('.aiButton').id('saveold');
<a class="aiButton" id="savenew" href="login.php"><span>Save</span></a></li>
Run Code Online (Sandbox Code Playgroud)
你知道我想从savenew中获取id,saveold这就是你如何做到这一点,我想这就是谢谢!!
我这样做:
$('.aiButton').click(function()
{
// $(this).removeAttr('id');
$(this).attr('id', 'id-name-goes-here');
});
Run Code Online (Sandbox Code Playgroud)