I am using jquery with a jquery multi select extension.
For my html syntax:
<select multiple="multiple" id="test">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
</select>
I then get the values of the multi-select with:
$(function() {
$('#test').change(function() {
console.log($(this).val());
}).multipleSelect({
width: '100%'
});
});
This works 100%.
my question is how do I get this to work when the ID has a space in it. I know it isnt ideal to have a space in an ID or Name but it is what it is currently and I need to get the multiple select options from the ID with a space. so example:
<select multiple="multiple" id="test two">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
</select>
$(function() {
$('#test two').change(function() {
console.log($(this).val());
}).multipleSelect({
width: '100%'
});
});
this fails with the space in it.
I have tried a few options like below without any success.
any advice appreciated a always.
$(function() {
$("#test two").change(function() {
console.log($(this).val());
}).multipleSelect({
width: '100%'
});
});