Click here to Skip to main content
15,886,861 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I used kg to lbs when creating a google chrome extension that converts units, but it keeps on saying error. What alternative can I use?

What I have tried:

<button onclick="kg_lbs()">kg to lbs</button>
Posted
Updated 24-Sep-22 14:35pm
v2
Comments
Dave Kreskowiak 24-Sep-22 20:35pm    
...and the error is...?

1 solution

Change this to the following and it will work:

html:

<button id="myButton">Click me</button>
<script src="script.js"></script>


script.js:

document.getElementById("myButton").addEventListener("click", myFunction);

function myFunction(){
  console.log('change this function to your function');
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900