JS Control tr Display and hide

Source: Internet
Author: User

Long time no code, recently a new project, began to record their own development process encountered some problems.

On the display and hiding of JS control tr

The first thing to do is:

<tr id= "att" style= "display:none;" >

<TD style= "text-align:right;" > Accessory File:</td>


<div id= "Div_fujian" >

<div class= "Input-outer" ><input type= "file" class= "Tuitrim input" name= "Fujian" size= "MaxLength" = "Id=" "Fujian" tabindex= "1"/></div>


<input type= "button" id= "BTN_ADD2" value= "Add Attachment" >



js Method: Function setdetailmsgrow (Rowid,sel)  {     var row = document.getelementbyid (RowID);        if   (Row != null)  {         if  (sel.value  == 0)  {         row.style.display =  " Block ";        }          else {         row.style.display =  "None";  &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;}&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;}&NBSP: But at the end of the day, when we look at the effect, we find that there will be dislocation. , such as 

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8B/90/wKiom1hRBJXCfiT2AAArHo_V1kU183.png-wh_500x0-wm_3 -wmp_4-s_1292911146.png "title=" 123.png "style=" WIDTH:500PX;HEIGHT:444PX; "width=" "height=" 444 "border=" 0 " Hspace= "0" vspace= "0" alt= "wkiom1hrbjxcfit2aaarho_v1ku183.png-wh_50"/>

Control display of the TR appears, there has been a dislocation phenomenon, to find the cause, as follows:

The use of display = block will become blocks of elements, such settings will change the layout of the page, so it will be misplaced;

Then how to set up, can realize the JS control tr display and hide it,

You can change the display property to Table-row

For Table-row's instructions like, you can learn, I learned

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/91/wKiom1hRBebCf7DYAACKyp4t398735.png-wh_500x0-wm_3 -wmp_4-s_1832477583.png "title=" 243.png "alt=" Wkiom1hrbebcf7dyaackyp4t398735.png-wh_50 "/>

This article is from the "butcher36" blog, make sure to keep this source http://butcher36.blog.51cto.com/9315484/1882726

JS Control tr Display and hide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.