简体   繁体   English

ID包含特定字符的原型选择元素

[英]Prototype select element with id that contains specific character

I have a select box like this: 我有一个这样的选择框:

<select id="_item13country_id" name="address[13][country_id]" class="required-entry countries required-entry select required-entry select">
 <option value=""> </option>
 <option value="TH" selected="selected">Thailand</option>
</select>

I need to select that by using prototype to find which element that contains 我需要通过使用原型来查找包含以下内容的元素来进行选择

country_id country_id

How can I do that ?. 我怎样才能做到这一点 ?。 Many thanks for your help. 非常感谢您的帮助。

Try this 尝试这个

$$("[id*=country_id]")

This will select all the elements where id is country_id 这将选择idcountry_id所有元素

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM