0

Why my code isn't working?

<html > <head> <title>Untitled Document</title> </head> <body> Maths:<input type="number" id="m" min="0" max="40" /> Hindi:<input type="number" id="h" min="0" max="40"/> English<input type="number" id="e" min="0" max="40"/> <input type="submit" onClick="ok()"/> <script> function ok(){ var m=$("m").val(); var h=$("h").val(); var e=$("e").val(); console.log(((m+e+h)*100)/120); } </script> </body> </html>

2nd Feb 2019, 12:30 PM
Major Vicky
Major Vicky - avatar
1 Answer
+ 7
Looks like you're trying to use jQuery without embedding the jQuery library. Go to the jQuery tutorial. Pretty much the first thing that is taught is how to include the jQuery library.
2nd Feb 2019, 12:39 PM
Anna
Anna - avatar