简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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