I want to use the state of a checkbox as a parameter to a call of a website.
I.E. there is a checkbox <input type="checkbox" id="myCheck">
and a hyperlink <a href=“/action.php“>newSite</a>
Depending on the state of the checkbox, an additional parameter should be added to the href parameter,
e.g. when not checked: href=“/action.php“
when checked: href=“/action.php?state=checked“
I don’t want to have an extra submit button, but simply by clicking on the link newSite the call to the new website should have the parameter or not depending on the state of the checkbox.
How do I program this in HTML and JavaScript?