I think what I am trying to achieve can be done in a simpler manner. However I have little JS experience and none in the way of CSS. So I’m utilizing prebuilt CSS and JS code and subtlety modifying it. So I will explain my end goal and see if what I currently have is acceptable.
- A top menu on the webpage that has push buttons and checkboxes that all visually look the same
- I would like checkboxes to look like buttons, e.g. no checkbox only the label.
- I would like for the checkbox to still retain its functionality as a checkbox given the JS code it is calling
- Is the way I’m calling the JS code through the button and checkbox correct or too complicated?
<li><a title="Zoom to U.S" input type="button" name="US" onclick="US();"><span>Zoom to U.S.</span></a></li>
<li><a title="Test 1 KML"><input type="checkbox" id="kml-red-check" name="kml-red-check" onclick="toggleKml("red");"><span>Test 1 KML</span></a></li>