I'm trying to set a checkbox to checked from an if statement but it just doesn't seem to want to work...
This is the HTML:
<input type="checkbox" id="aircon" name="aircon" onchange="QuoteRefresh();" class="toggle" />
and this is within my .js file:
$('#aircon').prop('checked', true);
I can't see any errors in the console.
Can anyone shed any light on this.
It's within a AJAX success response:
if (SelectedLevel == "Gold") {
$('#aircon').prop('checked', true);
}
Can anyone help me??
This is what I'm getting within the console:
[input#aircon.toggle, context: document, selector: "#aircon", constructor: function, init: function, selector: ""…]
0: input#aircon.toggle
context: document
length: 1
selector: "#aircon"
__proto__: Object[0]