0% found this document useful (0 votes)
33 views

Practice Javascript

The document contains multiple HTML pages with JavaScript code that sets the innerHTML of paragraph elements. The JavaScript code performs calculations, concatenates strings, and sets variables to output different data types including numbers, strings, and the results of calculations.

Uploaded by

baxekis926
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Practice Javascript

The document contains multiple HTML pages with JavaScript code that sets the innerHTML of paragraph elements. The JavaScript code performs calculations, concatenates strings, and sets variables to output different data types including numbers, strings, and the results of calculations.

Uploaded by

baxekis926
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

<!

DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>

<h1> The value from the javascript script is given below: </h1>

<p id = "demo"> </p>

<script>

document.getElementById("demo").innerHTML = 10.09;

</script>

</body>

</html>

<!DOCTYPE html>

<html>
<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>

<h1> The value from the javascript script is given below: </h1>

<p id = "demo"> </p>

<script>

document.getElementById("demo").innerHTML = "Jane Petes";

</script>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>
<body>

<h1> The value from the javascript script is given below: </h1>

<p id = "demo"> </p>

<script>

document.getElementById("demo").innerHTML = (((14 * 2) + 22) - 9) / 7;

</script>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>
<h1> The value from the javascript script is given below: </h1>

<p id = "demo"> </p>

<script>

let x, y, z;

x = 10;

y = 4;

z = x + y;

document.getElementById("demo").innerHTML = z;

</script>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>
<h1> The value from the javascript script is given below: </h1>

<p id = "demo"> </p>

<script>

let x;

x = 5;

document.getElementById("demo").innerHTML = x * 10;

</script>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>
<h1> The value from the javascript script is given below: </h1>

<p id = "demo"> </p>

<script>

let x;

x = 4;

document.getElementById("demo").innerHTML = "John" + " " + "Doe " + x;

</script>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>

<h1> The value from the javascript script is given below: </h1>
<p id = "demo"> </p>

<script>

var x, y;

x = 10 + 8;

y = x * 5;

document.getElementById("demo").innerHTML = y;

</script>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>

<h1> The value from the javascript script is given below: </h1>
<p id = "demo"> </p>

<script>

let x;

x = 18;

//x = x + 5;

/* x = (2 * x) + 4;

x = x / 5; */

document.getElementById("demo").innerHTML = x;

</script>

</body>

</html>

<!DOCTYPE html>

<html>

<head>

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0">

</head>

<body>
<h1> The value from the javascript script is given below: </h1>

<p id = "demo01"> </p>

<p id = "demo02"> </p>

<script>

let name, Name;

name = "John Doe";

Name = "Jane Petes";

document.getElementById("demo01").innerHTML = name;

document.getElementById("demo02").innerHTML = Name;

</script>

</body>

</html>

You might also like