jQuery多个ID选择器 [英] jQuery Multiple ID selectors
本文介绍了jQuery多个ID选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我的代码开头的片段:
Here's a snippet of the start of my code:
var myUpload = $("#upload_link").upload({bla bla bla
基本上我要做的就是和几个不同的人打同一个电话ID's ...
Basically what I'm trying to do is make the same call with a few different ID's...
我原以为这会起作用但不会:
I would have assumed this would work but it doesn't:
var myUpload = $("#upload_link,#upload_link2,#upload_link3").upload({
任何想法?
推荐答案
试试这个:
$("#upload_link,#upload_link2,#upload_link3").each(function(){
$(this).upload({
//whateveryouwant
});
});
这篇关于jQuery多个ID选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文