A text box on a web page is used to modify the IP address. After editing the content in the text box, its style changes to resemble a second box. How can the style be changed back to that of the original text box? JavaScript is being used on the client side and the web client is Internet Explorer 7.
Below is the code snippet in an ASP page that creates the text box:
<td style="height: 27px"><input type="text" id="txtIpAddressHost" name="txtIpAddressHost" value="" onchange="ValidateParameter(this);" onkeydown="this.style.backgroundColor='white'" disabled="disabled" maxlength="15" /></td>
The HTML before and after the changes are shown below:
Before Keypress
<input type="text" onkeydown="this.style.backgroundColor='white'" onchange="Validate(this);" maxlength="10" value="-30.000000" name="txtCoolSetPointCkt1" id="txtCoolSetPointCkt1">
After Keypress
<input type="text" onkeydown="this.style.backgroundColor='white'" onchange="Validate(this);" maxlength="10" value="-30.000000" name="txtCoolSetPointCkt1"id="txtCoolSetPointCkt1" style="background-color: white;">
CSS change
css change
{
background-color: white;
}