I have a text box like this:
<input id="patId1" type="text" name="patId1" value="">
when the page loads, a script is called that sets the width of the text field. This code is as follows:
document.getElementById("patId1").style.width = document.getElementById("patId2").offsetWidth;
where, patId2 is a drop-down list (select tag). Basically, I am trying to set the width of the text box in the same way as the width of the dropdown.
Now, if DOCTYPE is installed, then the above script does not work. But if it is not installed, the width applies.
Any help.
source
share