タイトル通りです。
htmlとjavascriptのファイルは同階層にあります。
html
1<!DOCTYPE html> 2<html lang="ja"> 3<head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <meta http-equiv="X-UA-Compatible" content="ie=edge"> 7 <title>Document</title> 8 9</head> 10<body> 11 <h1>Javascript Practice</h1> 12 <script src="script.js"></script> 13</body> 14</html>
javascript
1var tax=1.08; 2 3var price =prompt("商品の総額を数値で入力してください"); 4 5var result=Mach.round(price*tax); 6alert("お買い上げの会計は、消費税込みで"+result+"円です");
回答1件
あなたの回答
tips
プレビュー