作者UniFish (贡贡老盃)
看板Ajax
标题Re: [问题] 元素阵列
时间Wed Mar 23 22:00:59 2011
※ 引述《averywu (看文不要只会用横的看)》之铭言:
: 请问要怎麽使用Jquery 选取不特定长度阵列元素呢?
: <input type="text"id="goods[1]">
: <input type="text"id="goods[2]">
: <input type="text"id="goods[3]">
: 其中,goods[X]的X不是固定的,数量也不会固定。
: 我试过 $('#goods[*]').size();
: 是没用的。有什麽比较直接的方法呢?
<input type="XXX" id="item1" />
<input type="XXX" id="item2" />
<input type="XXX" id="item3" />
...
<input type="XXX" id="itemn" />
$("input[id^=item]") 搞定!!
--
◣◥
◤◢ ◣▁◢ 请‧尊‧重‧生‧命
◤
◢◤ ‧‧▏ ◥ ◤
以 认 养 代 替 购 买
◤◢ ▄▄▄▄ ‧‧
◢◤ 请领养我 ▄ ▄ 以 绝 育 代 替 扑 杀
◤◢ 请领养我▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Blog:http://Unifish.Pixnet.net/ 本BLOG谢绝挖隐私魔人 QSWEET
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.33.192.74