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 ~