I'm working with jQuery and I have this element:
<input class="css-checkbox" id="services[3492][selected]" name="services[3492][selected]" type="checkbox" value=" 1">
When I try to get that item in my console through its ID — services[3492][selected]
— I get an empty response: []
.
Code:
$('#services[3490][selected]') // Not working
$('[id*="services[3490][selected]"') // Working
I think it's because the [
characters. Maybe I need to sanitize, or use some escape characters or unicode transformation.