Below you will find my code for a web program that takes in changes and will change the last area. I am wondering if i need to make the last box a textarea? Also any help with the javascript will be greatly appreciated and any other ways to make it better will be also.
<!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>Dynamic Section Formatting</title>
<script type ="text/javascript" src = "hw5.js">
</script>
</head>
<body>
<p style ="font-family: Times; font-syle:bold;
font-size: 24pt;text-align:center;">
Dynamic Section Formatting
</p>
<form action = "">
<table border ="1">
<label>
<tr>
<td>Border Color:</td>
<td><input type = "text" name = "border" size ="20"
onchange = "setColor('border', this.value)" /></td>
</label>
</tr>
<br />
<tr>
<label>
<td>Text Color:</td>
<td><input type = "text" name = "text" size ="20"
onchange = "setColor('text', this.value)" /></td>
</label>
</tr>
<br />
<tr>
<label>
<td>Background Color:</td>
<td><input type = "text" name = "background" size ="20"
onchange = "setColor('background', this.value)" /></td>
</label>
</tr>
<br />
<tr>
<label>
<td>Font Size:</td>
<td><input type = "text" name = "font" size ="20"
onchange = "setColor('font', this.value)" /></td>
</label>
</tr>
<br />
<tr>
<label>
<td>Font Weight:</td>
<td><input type = "radio" name = "weight" size ="20"
onchange = "setWeight('weight', this.value)" />Normal<br />
<input type = "radio" name = "weight" size ="20"
onchange = "setWeight('weight', this.value)" />Bold</td>
</label>
</tr>
<br />
<tr>
<label>
<td>Visibility:</td>
<td><input type = "button" name = "vis" size ="20"
onclick = "setColor(); "value="Change Visibility"/></td>
</label>
</tr>
<br />
</table>
</form>
<br /><br />
<p style = "font-family: Times; font-syle:bold;
border-color: red; border-style:solid;
border-width:10px;background-color:grey;">
Section 1<br /><br />
Here is the first paragraph
</p>
</body>
</html>
function setColor(where, newColor){
if(where == "background")
document.body.style.backgroundColor= newColor;
else
document.body.style.color= newColor;