I'm completely new to Backbone.js and jQuery and I'm trying to set an input field of a form to "disabled" when I check a checkbox. I'm not sure if I have to do it the way I show in the code below, if so what should I do in the disableInput function?
JS
events: {
'change #myCheckbox': 'disableInput',
},
disableInput : function(){
...
}
HTML
<div class="x">
<input type="text" id="myInput">
<input type="checkbox" id="myCheckbox">
<div>
EDIT: This may seem like dupplicate of other posts, but those questions are about vanilla JS I'm using Backbone here so it's not the same.
document.getElementById("myInput").disabled= document.getElementById('myCheckbox').checked