In the following code, how can I change the textcolor in the Others textbox.
Code:
<html>
<head>
<script>
function other()
{
if(document.frm.country.selectedIndex == 2)
{
document.frm.oth.disabled = false;
document.getElementById(‘oth’).style.background=’white’;
document.getElementById(‘oth’).style.foreground=’blue’; //change the textcolor
document.frm.oth.focus()
}
else
{
document.frm.oth.disabled = true;
document.getElementById(‘oth’).style.background=’#cccccc’;
}
}
</script>
</head>
<body>
<form name = “frm”>
<select name = “country” onChange = “other()”>
<option value = “Mrt”>Mauritius
<option value = “India”>India
<option value = “Others”>
<br>
<br>
Other <input type=text name=”oth” id=”oth” disabled style = “background-color=’#cccccc'”>
</form>
</html>