0

In both chrome and IE, this code fails:

<script type="javascript">
    var state = false;
    function jsClicked(){
        state = !state;
        console.log("Clicked " + state);
    }
</script>

<input id="jsClicked" name="jsClicked" type="checkbox" onclick="jsClicked()">
</input>

but changing the name of the onclick function resolves the issue. The error being thrown is:

Uncaught TypeError: object is not a function

Here's the fiddle: onclick error fiddle

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
roguequery
  • 964
  • 13
  • 28

0 Answers0