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:
note had change array definition:
var = []; i[1] = 23;
Comments
Post a Comment