Some practical methods of jquery for TR TD (Must see article) _jquery

Source: Internet
Author: User

This article describes the operations of the TR and TD in jquery on the table.

The first knowledge points empty tr

<span style= "FONT-SIZE:18PX;" ><tr id= "Dynamictrone" ></tr></span>

Suppose you have dynamically created TD for Id=dynamictrone TR, you can use the

$ ("#dynamicTrOne"). empty ();

Destroy all TD in the TR

The second knowledge point creates a TD element

The code is as follows:

var TD1 = $ ("<td width= ' 140px ' >" +<strong><span style= "color: #ff6666;" >strkey0</span></strong>+ ":</td>");
var TD2 = $ ("<td width= ' 60px ' ><input name= ' strKey0" value= ' ${strkey0} ' class= ' LogType ' ></input>< /TD> ");

If it is a variable, such as strKey0, it needs to be enclosed with two + numbers.

The third knowledge is that TD is appended to TR

The code is as follows:

$ ("#dynamicTrOne"). Append (TD1);

The fourth knowledge point changes the content of TD

The HTML code is as follows:

<span style= "FONT-SIZE:18PX;" ><TD class= "Back-concen-tab-top" id= "StrKey0" >str_key0</td></span>

The jquery code is as follows:

$ ("#strKey0"). HTML ("Str_key0");

The above is a small series of jquery for you to bring some practical operation method of TR TD (Must see article) all content, I hope we support cloud Habitat Community ~

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.