i have a table which in which i have td .when i click in text field which has onkeypress
event select values from database a table is shown from whic i select value.this select table is in div which position is fixed.but it will also chang the height
<td class="value">vehicle </td><td>
<input type="text" id="txt_sh_vid" onKeyPress="vhc_record()" maxlength="4">
<div id="div_vhc" class="search_form">
</div>
<input type="text" id="vid" style="display:none;">
JavaScript:
function vhc_record() {
var data = 'vhc=' + document.getElementById('txt_sh_vid').value;
loadXMLDoc('ship/vehicle_ship/', 'div_vhc', data);
document.getElementById('div_vhc').style.visibility = "visible";
}
it is css of the above table
td.value
{
background-color:#00628B;
color:#E6E6DC;
height:50;
}
div.search_form
{
position:fixed;
background-color:white;
}
when i press key in textfield it will also change the height of class=”value”
like div id=”div_vhc” while its height is 50
Here is the JSFiddle Demo. Let me know if this is what you are looking for:
I am guessing what you are looking for is to grab
td.valuewidth and height. You can useoffsetHeightoroffsetWidthI am not very sure what you are trying to do, but to get the height of
td.valueyou can do the following assume based on the structure of html. of course if you wish to traverse through all td element and find the element w/ the class name value then you’ll have to use regex to match the element with value as part of its class:Your vhc_record function midified:
The changes i made to the html and css and i added some visiblity properties to make the example looks apparent: