3 ms·
Its a typo then? onclick="addFruit" is not the same as onclick="addFruit()"
by orangepanda 3y ago
Its a typo then?
onclick="addFruit"
is not the same as
onclick="addFruit()"
- tipiirai 3y agoThe onclick="addFruit" calls an instance method between the inner script tags. Similar to how JS would call a global window.addFruit with a similar syntax.
- orangepanda 3y agoKeyword being "similar", as in, not the same. Its neither the behaviour of html onclick attribute, nor dom onclick attribute.