Reputation: 1
when we enter the number in the form of html it will automatically multiply by 20. how to show the the answer on next field while using html?
Upvotes: 0
Views: 457
Reputation: 151
Add an event listener.
<form>
<input type="text" id="t1" oninput="getElementById('t2').value = this.value * 20">
<input type="text" id="t2">
</form>
Upvotes: 1
Reputation: 29121
HTML is a markup language (used for structuring/organizing your data), not a programming language (used for calculations...etc). For calculations, you'll likely want to utilize JavaScript to retrieve the values from the HTML fields, do some calculations, then write the value to the next field. There are other options, but that's probably the best place to start.
Upvotes: 2