Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我创建一个 html 标签时,例如:
$j('#edit-gen').append("<a class=reloadInput href=javascript:void(0)> change </a>"); $j('.reloadInput').click(function(){ alert("test"); });
我想使用,例如点击事件,而不是回答,但如果标签已经创建,如果它响应。它好像有。提前谢谢,对不起我的英语
您必须像使用一些委托一样.on():
.on()
$j(document).on('click','.reloadInput',function(){ alert("test"); });
我不确定,但我认为需要引号来包装类“reloadInput”和“javascript:void(0)”