| Page 1 of 1 | [ 7 posts ] |
|
I have a select element which has only the name (neither id, nor CSS, etc.)
Code: <select name="assigned_user_id_advanced[]" size="6" style="width: 150px" multiple="true">[option_list]</select> How can I grab it into Node like document.getElementsByName? |
|
It looks like working selector is
Code: var node = Y.one('select[name="assigned_user_id_advanced[]"]'); |
|
I don't know how important performance is, but this might be a bit faster:
Code: var node = Y.one(document.getElementsByName('assigned_user_id_advanced[]')[0]); |
|
It's probably most likeness document.getElementsByName().
Code: Y.all('*[name="assigned_user_id_advanced[]"]').item(0); How's that? |
|
this was more like it Ryuichi.
|
|
Ryuichi,
Can I relace Y.all with Y.one? Code: Y.one('*[name="assigned_user_id_advanced[]"]'); |
|
PQR,
Right, if you need single and first element by selector. |
| Page 1 of 1 | [ 7 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group