select by name and array value with jquery -


i thought this:

i[1] = 23; // built regex  $('select [name="sys_map\\['+i[1]+'\\]"]').css('border-color', '#ff5c5c'); 

or maybe

$('select [name=sys_map\\['+i[1]+'\\]]').css('border-color', '#ff5c5c'); 

to select

<select name="sys_map[23]"> 

quoting name shows error:

[15:36:27.647] error: syntax error, unrecognized expression: select [name="sys_map[1]"

you have space between 'select' , name attribute selector, you're looking elements match attribute selector descendants of select.

change

$('select [name="sys_map\\['+i[1]+'\\]"]') 

to

$('select[name="sys_map['+i[1]+']"]') 

here's fiddle:

http://jsfiddle.net/nyakm/

note had change array definition:

var = []; i[1] = 23; 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -