I have the following select with an unusual ID/Name attribute:
<select name="customfield_10021:1" id="customfield_10021:1" class="select cascadingselect-child">
This doesn’t appear to allow me to select it with:
unit = $('#customfield_10021:1 option:selected').text();
uncaught exception: Syntax error, unrecognized expression: 1
How can I select this field? I’ve never even seen this particular syntax before, but it apparently works on submit.
Thanks!
Jared
Escape the
:by using\\Updated jsfiddle
Or you can use
document.getElementById("customfield_10021:1")as the context for your selector.