我可以执行类似下面的操作,我可以让多个类触发事件吗?
$('a.red a.blue a.green').click(function(event)
{
});
Run Code Online (Sandbox Code Playgroud)
Bal*_*usC 18
是的,您可以使用逗号作为分隔符.
$('a.red, a.blue, a.green').click(function(event) {});
Run Code Online (Sandbox Code Playgroud)