AnsweredAssumed Answered

Checkbox onclick can not control the function, why?

Question asked by steven.lzhou on Jan 7, 2014
Latest reply on Jan 13, 2014 by steven.lzhou
I tried to create a check box to turn on/off a layer.  The checkbox is just html code, and I want to control it by using the method onclick, as the following:
<input type='checkbox' class='list_item' id='0' value=0                     onclick="updateLayerVisibility();"/>PM2.5


The updateLayerVisibility() is defined in <script> </script> as the following:
function updateLayerVisibility (....DynamicLayer.visible = true; ) {}


I did not finish the function yet, but the test run always indicated that function updateLayerVisibility () is not defined.  I am very confused, I put checkbox in <body> </body> block, and put the function updateLayerVisibility() in the part B, like require ([ ...], fucniton () { part B}), why the onclick() is not working?  Any suggestion would hlep!  Thank you very much!

Outcomes