Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
<form id="guessNumber">
</form>
<p id="output"></p>
<script type="text/javascript">
function verify() {
output = document.getElementById('output');
if (isNaN(guess)) {
}
return false;
document.getElementById('guessNumber').onsubmit = verify;
</script>
9:
<!doctype html>
<html>
<head>
<script>
function odd_even(){
var no;
no=Number(document.getElementById("no_input").value);
if(no%2==0)
{
alert("Even Number");
}
else
{
alert("Odd Number");
}
}
</script>
</head>
<body>
Enter Any Number:<input id="no_input"><br />
<button onclick="odd_even()">Click me</button>
</body>
</html>
11 Answer:
if (calcValue) {
}
};
document.getElementById(inputs[i].id).onclick = calcu;
for (var i = 0; i <= inputs[id].length, i++) {
/* input button elements onlick handler needs to be set to (equal to?) a
function that calls the calcu variable inside of it */
if (input.type = button) {
console.log()
<body>
<div id="content">
<div id="calculator-container">
<!-- DO NOT CHANGE THE FORM! Only use external JavaScript files -->
<form name="calc">
<label for="output">A Basic Calculator</label>
<!-- the name of the textbox is "output" -->
<input id="output" name="output" type="text" readonly>
<br>
<input type="button" id="1" value=" 1 ">
<input type="button" id="2" value=" 2 ">
<input type="button" id="3" value=" 3 ">
<input type="button" id="+" value=" + ">
<br>
<input type="button" id="4" value=" 4 ">
<input type="button" id="5" value=" 5 ">
<input type="button" id="6" value=" 6 ">
<input type="button" id="-" value=" - ">
<br>
<input type="button" id="7" value=" 7 ">
<input type="button" id="8" value=" 8 ">
<input type="button" id="9" value=" 9 ">
<input type="button" id="*" value=" x ">
<br>
<input type="button" id="c" value=" C ">
<input type="button" id="0" value=" 0 ">
<input type="button" id="equate" value=" = ">
<input type="button" id="/" value="÷">
</form>
</div>
</div>
</body>
Answer 6:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Grade Calculator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<link rel="javascript" href="script.js">
</head>
<body>
<header>
<h1>SAIT Grade Calculator</h1>
</header>
<main class="wrapper">
<h1> Grade Calculator </h1>
</main>
<script>
function setGrades (){
var gradeobtained =
parseFloat(document.getElementById('enumerator').value);
var gradepossible =
parseFloat(document.getElementById('denominator').value);
</script>
<footer>© Nicole 2017</footer>
</body></html>