How Do I Reference An Element By Name With [] Brackets In It?
- by user384030
How do you reference a element in jquery BY NAME that has the [] in it.
<select name="values[]" multiple="true">
<option value="1">1</option>
<option value="2">2</option>
<option value="2">2</option>
</select>
<script type="text/javascript">
$('[name=values[]]');
</script>
this should grab the element, but it does not work, I believe the [] in the name is messing it up, escaping it doesn't seem to work either. I can't figure out what I'm doing wrong