here you can see my code im stuck with trying to input 2 numbers by user in html calling function then adding those 2 in js then printing in html
html.
<html>
<head>
<meta charset="utf-8">
<title> JavaScript | Basics</title>
<script src="basics.js" charset="utf-8"></script>
</head>
<body>
<!-- <input type="number" name="a" value="0" id="a">
<input type="number" name="b" value="0" id="b">
<button type="button" onsubmit="window.alert(a+b)" name="button">j</button>
< Start JavaScript Here -->
<form onsubmit='sum(a,b)'>
<label for="a">Input number a</label>
<input type="number" name="a" value="0" id='a'>
<br>
<label for="a">Input number b</label>
<input type="number" name="b" value="0" id='b'>
<button type="submit" name="submit">Submit</button>
<output id="total"></output>
</form>
</body>
</html>
js
// 34343
// window.alert()
function sum(a, b) {
console.log('hello world');
var c;
c.value = parseInt(a) + parseInt(b);
console.log(c.value);
window.alert(c.value);
document.getElementById('total').innerHTML = 'The value of s ' + c.value;
}
// </script>
help please