<html> <head> <title>TAG index Webサイト</title> <script type="text/javascript"> <!-- function keisan(){ // 設定開始 var tax = 10; // 消費税率 // 商品1 var price1 = document.form1.goods1.selectedIndex * 500; // 単価を設定 document.form1.field1.value = price1; // 小計を表示 // 商品2 var price2 = document.form1.goods2.selectedIndex * 1000; // 単価を設定 document.form1.field2.value = price2; // 小計を表示 // 商品3 var price3 = document.
![JavaScript/フォーム/自動計算フォームAタイプ(消費税あり) - TAG index](https://cdn-ak-scissors.b.st-hatena.com/image/square/4f9442d6a13ed8b2d2bf932784e7d4613227a381/height=288;version=1;width=512/https%3A%2F%2Fwww.tagindex.com%2Fimage%2Fogp%2Fjavascript.png)