HTMLとJavaScriptで単純な時間と半分の電卓を作ったが、何らかの理由で計算ボタンボタンをクリックすると、P要素に結果が表示されない。ここでJavaScriptの単純な時間と半分の計算機
は私のコードです:
http://codepen.io/chrissylvester10/pen/wJxder
html>
<head>
</head>
<body>
<h1>Time and Half Calculator</h1>
<input id="fare" size="7" maxlength="7" name="fare" style="width:75px" value="0" />
<input type="button" value="Calculate" onclick="calculator()">
<p id="result"></p>
</body>
</html>
var fare = document.getElementById("#fare").value;
function calculator() {
var result = fare/2 + fare;
document.getElementById("result").innerHTML = result;
}
私は変更を確認する必要があるので、それをforkしてください。
"html>' "で実際に始まっていますか? –
申し訳ありません私はそれを紛失しました。 – Chris