Output tag in HTML
- 24-07-2022
- Trung Minh
- 0 Comments
The output tag represents a calculation result (as a result of a script statement).
So when should you use the output tag?
Of course, when one displays a certain calculation result. Specifically, when you want to show the amount to be paid by another for an already priced item, and that amount will depend on the quantity of the item. the client wants, then the output tag will be very useful.
Using
Example : Display the amount to be paid by the guest depending on the quantity they choose:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <h1>Học html miễn phí tại web888.vn</h1> <form oninput="x.value=parseInt(a.value)*parseInt(b.value)"> <label>Số lượng</label> 0<input type="range" id="a" value="50">100 <br> <label>Đơn giá</label> <input type="number" id="b" disabled="disabled" value="5000"> <br> <label>Tổng tiền</label> <output name="x" for="a*b"></output>đ </form> </body> </html>