I recently added this function to my .js file for my website:
function toggleActive() {
$("#terminalLabel").addClass("active");
}
for:
<input id='terminal' class='hidden' type='checkbox' placeholder='Terminal Option' name='terminal[0][]'>
<label id='terminalLabel' class='btn btn-default' for='terminal2' onclick="toggleActive()">Terminal Option</label>
I kept getting an uncaught reference error when I would try to activate the function, but didn't know why.
I put the function in script tags to see if it worked, and it did. I added a different function to the button that was already defined in the same .js file that I made this new function, and that function worked.
Then I changed the name of the file from form.js to form1.js and had my site call it up, and then the function just worked. Why is this?