Scriptalicious & JS DOM Issue

Hi

I’m trying to check if a checkbox is checked and if it is show a panel.

This works however if you click the tickbox again and it still shows but I’m unsure why the code below doesn’t work?

Any tips?

function checkrighttowork() {
						
							if (document.getElementById('righttowork').checked=true) {
								 $("decextras").show();
							} else if (document.getElementById('righttowork').checked=false) {
								 $("decextras").hide();
							} 
						}

I haven’t tested to ensure this works as you expected, but, at a first glance, you are using “=” (assignment operator) instead of “==” (comparison operator).