Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <script>
- function area_calc(l,w)
- {
- document.calc.area.value = l*w;
- document.calc.perimeter.value = parseInt(l) + parseInt(w) + parseInt(l) + parseInt(w);
- }
- </script>
- <body>
- <form name = "calc">
- please enter the length and width of a room and this program will give you the Area and Perimeter
- <br>
- length<input type = text name = "length" value = "" size = "7"
- onchange= "area_calc(document.calc.length.value,document.calc.width.value)">
- width<input type = text name= "width" value="" size ="7"
- onchange="area_calc(document.calc.length.value,document.calc.width.value)">
- area<input type = text name= "area" value="" size ="7">
- perimeter<input type = text name= "perimeter" value="" size ="7">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement