ASDV-WebDev/Semester 1/Chapter ZIPs/JavaScript/ch04/ex_4_12.html

28 lines
785 B
HTML

2023-03-14 08:51:55 +07:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Example 4.12</title>
<script>
var j = 1; j++;
document.write("<h3> if j = 1, then j++ is " + j++ + "!</p>");
j = 1; j--;
document.write("<h3> if j = 1, then j-- is " + j + "!</p>");
j = 5; j+=2;
document.write("<h3> if j = 5, then j+=2 is " + j + "!</p>");
j = 5; j-=2;
document.write("<h3>if j = 5, then j-=2 is " + j + "!</p>");
j = 4; j*=3;
document.write("<h3> if j = 4, then j*=3 is " + j + "!</p>");
j = 4; j/=2;
document.write("<h3> if j = 4, then j/=2 is " + j + "!</p>");
j = 1; ++j;
document.write("<h3> if j = 1, then ++j is " + j + "</p>");
j = 8; --j;
document.write("<h3> if j = 8, then --j is " + j + "!</p>");
</script>
</head>
<body>
</body>
</html>