Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4079310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:47:07+00:00 2026-05-20T17:47:07+00:00

i have a table which in which i have td .when i click in

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:47:08+00:00Added an answer on May 20, 2026 at 5:47 pm

    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.value width and height. You can use offsetHeight or offsetWidth

    I am not very sure what you are trying to do, but to get the height of td.value you 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:

    var myvalue = document.getElementsByTagName('td')[0];  //grabs the td.value element based on your html markup
    
    document.getElementById('div_vhc').style.height = myvalue.offsetHeight+'px';  //sets div_vhc height to that of td.value
    document.getElementById('div_vhc').style.width= myvalue.offsetWidth+'px';//sets div_vhc width to that of td.value
    

    The changes i made to the html and css and i added some visiblity properties to make the example looks apparent:

    <table><tr><td class="value">vehicle </td></tr></table>
    <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;">
    
    td.value
    {
        background-color:#00628B;
        color:#E6E6DC;
        height: 50px;   
        width: 50px;
    }
    
    #div_vhc
    {
        position:fixed;
        background-color:white;
        display: none;
        border: 1px solid black;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a SQL server database, I have a table which contains a TEXT field
Currently we have a table with a bunch of data from a database which
If you have a table which holds history (updates, deletes) from another table, how
I have a table y Which has two columns a and b Entries are:
I have an Oracle table which contains event log messages for an application. We
I have a table which has one row and only one cell will be
So you have UINavigationController, with a parent table which has one cell --------------- |
I have a table in which i append rows on onclick event, the row
I have a table which is full of arbitrarily formatted phone numbers, like this
I have a table which is referenced by foreign keys on many other tables.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.