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!