Hey guys,

I'm trying to call two functions using the onclick attribute like so:

`<script src="main.js"></script>` `<button onclick="addCompetitor()">Add 
Competitor</button>` `<button onclick="delCompetitor(1)">Del 
Competitor</button>`

These functions are defined in a JavaScript file generated by Nim.

when serving my page, I keep getting errors when I click either button saying 
they're undefined:
    
    
    Uncaught ReferenceError: addCompetitor is not defined
        at HTMLButtonElement.onclick ((index):42)
    
    
    Run

I understand the JavaScript Nim creates is solely meant for the browser, but is 
there a way to achieve the functionality I want like the code above? Or am I 
forced to try to do something like add event listeners in the JavaScript file? 

Reply via email to