Rassac
asked on
Change / Hide text field on click
Hi,
I have the below code which works well to show the hidden text field but once the field is changed to inline-block it cannot be reverted back to hidden.
Can you please provide suggestions? Thanks.
I have the below code which works well to show the hidden text field but once the field is changed to inline-block it cannot be reverted back to hidden.
Can you please provide suggestions? Thanks.
function Change(){
if (document.getElementById( "myId" ).style.display = "none")
{
document.getElementById( "myId" ).style.display = "inline-block";
}
else
if (document.getElementById( "myId" ).style.display = "inline-block")
{
document.getElementById( "myId" ).style.display = "none";
}
}
<BODY>
<tr>
<td>
<input type="button" onclick="Change();" value="Click Me">
</td>
<!--<input type="button" onclick="Hide();" value="Java Hide"> -->
<td><input type=text id="myId" style="display:none"></input></td>
</tr>
</BODY>
</HTML>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you are welcome
ASKER