Develop a personal web page for yourself using HTML, CSS, and Javascript
Use the following HTML tags to design your webpage
<h1>...</h1>, <h3>...</h3>,<h6>...</h6>,<p>...</p>,<b>...</b>,<i>...</i>,<a>...</a>,<img>, <table> ... </table>, <div> ... </div>, <form> ... </form>, <input type ="text">, and <input type ="submit">
Use an external css to change the default style of your webpage. You must use at least one element selector, one id selector, and one class selector
Using text input and submit button, allow the user to change the background color of your web page to red, blue, or yellow. When the user clicks the submit button to change the background color, you must first validate the user input to make sure the entered color is valid (red, blue, and yellow are valid colors). Then, you should change the background color of your web page. If the user didn’t enter a valid color, you should prompt the user to enter a valid color.
SOURCE CODE
<!DOCTYPE html>
<html>
<body>
Colour: <input type="string" id="colour" value=" ">
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var x = document.getElementById("colour").value;
document.body.style.background = x;
}
</script>
</body>
</html>
OUTPUT SCREENSHOT
please give a upvote if u feel helpful.
Get Answers For Free
Most questions answered within 1 hours.