passing html vlaues to Javascript function
<body>
<h1>Adding 'a' and 'b'</h1>
a: <input type="number" name="a" id="a"><br>
b: <input type="number" name="b" id="b"><br>
<button onclick="add(document.getElementById('a').value,document.getElementById('b').value)">Add</button>
<script>
function add(a,b) {
var sum = parseInt(a) + parseInt(b);
alert(sum);
}
</script>
</body>
Also in HTML:
- excel vba largest value for Decimal data type
- html mailto
- do_action( 'wp_head' );
- embed github html
- jquery cdn google
- accept zip codes in html
- how to add javascript to html
- asp classic server show errors
- html input readonly
- ionic input
- html ecrire en gras
- how to show hide div in html javascript
- passing html vlaues to Javascript function
- take input date html
- vscode-jest intellisense not working
- how to make html modal popup
- slick slider cdn
- bootstrap display inline block
- html to json
- html xpath name
- flask sqlalchemy put data in html table
- html underline tag
- ubuntu vmplayer
- stylesheet einbinden html5