1.
write a web page with a Javascript to write, "Welcome to my very special page" with a line
break between "my” and "very".
<html>
<body>
<script>
document.write("Welcome to my" + "<br>" + "very special page");
</script>
</body>
</html>
2. write a web page with a javascript that display a paragraph with an image.
<html>
<body>
<p id="text">Welcome to my very special page!</p>
<img src="https://via.placeholder.com/150" id="image">
<script>
document.getElementById("image").style.width = "150px";
document.getElementById("image").style.height = "150px";
document.getElementById("image").style.float = "left";
document.getElementById("text").style.marginLeft = "165px";
</script>
</body>
</html>
3. Write Javascript code to do the following.
a. Read a number (using prompt) and display it using alert.
b. Read two numbers and display their product.
c. Read in two numbers and display the largest
// Read a number and display it using alert
var num1 = parseInt(prompt("Enter a number: "));
alert("The number you entered is: " + num1);
// Read two numbers and display their product
var num2 = parseInt(prompt("Enter the first number: "));
var num3 = parseInt(prompt("Enter the second number: "));
var product = num2 * num3;
alert("The product of " + num2 + " and " + num3 + " is: " + product);
// Read in two numbers and display the largest
var num4 = parseInt(prompt("Enter the first number: "));
var num5 = parseInt(prompt("Enter the second number: "));
var largest = (num4 > num5) ? num4 : num5;
alert("The largest number is: " + largest);