我有以下的jQuery代码。第一次单击链接时,什么也不会发生;但是,在第二次单击链接时,预期的操作发生。
$("a[rel]").bind("click", function(){
$(".close_button_change_password").attr('id','change_password_'+$(this).attr('id'));
$(this).overlay({
// disable this for modal dialog-type of overlays
closeOnClick: true,
mask: {
color: '#fff',
loadSpeed: 200,
opacity: 0.8
}
});
});
这里是我的 HTML 代码:
<a href="#" rel="#change_password" id="1">change password</a>
有人知道我该如何解决这个问题吗?非常感谢您提供的任何帮助。
ID
赋予数字值,比如:id="1"
。请使用字母作为第一个字符:id="a1"
。 - Roko C. Buljanid
属性。请参见此处。 - Donut