ASDV-WebDev/Semester 1/Assignments/JavaScript/MP09_CalebFontenot/public_html/Problem 7.html
2023-08-16 17:31:33 -05:00

36 lines
1.3 KiB
HTML

<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
-->
<html>
<head>
<script type="text/javascript">
function customize(option)
{
switch (option) {
case 1:
document.getElementById("p1").style.color = "red";
document.getElementById("p1").style.fontFamily = "Arial";
break;
case 2:
document.getElementById("p1").style.color = "blue";
document.getElementById("p1").style.fontFamily = "Helvetica";
break;
case 3:
document.getElementById("p1").style.color = "purple";
document.getElementById("p1").style.fontFamily = "sans-serif";
break;
}
}
</script>
</head>
<body>
<p id="p1">Hi there!</p>
<input type="button" onclick="customize(1)" value="customize 1" />
<input type="button" onclick="customize(2)" value="customize 2" />
<input type="button" onclick="customize(3)" value="customize 3" />
</body>
</html>