About the use of the sibling node in JS to view the current node

Source: Internet
Author: User

<tr>
&LT;TD align= "center" ><input style= "width:20px;" type= "checkbox" name= "CK"/></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fitemid" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fitemname" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fmodel" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fbatchno" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].funitid" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fauxqtymust" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input ondblclick= "FUN_TEVL (this);" Name= "Wgrkbillentry[0].fauxqty" maxlength= "" type= " Text "style=" width:100px; " ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fpurchaseprice" maxlength= "" type= "text" style= "width: 100px; " ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fauxprice" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].famount" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fpurchaseamount" maxlength= "" type= "text" style= "width: 100px; " ></td>
&LT;TD align= "left" ><input name= "wgrkbillentry[0].ftaxrate" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].ftaxamount" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fdcstockid" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fsourcebillno" maxlength= "" type= "text" style= "width: 100px; " ></td>
&LT;TD align= "left" ><input name= "Wgrkbillentry[0].fnote" maxlength= "" type= "text" style= "width:100px;" ></td>
&LT;TD align= "left" style= "Display:none;" ><input name= "Wgrkbillentry[0].id" type= "text" style= "width:0px;" ></td>
</tr>

Above is a TR, no ID, now on one of the name Wgrkbillentry[0].fauxqty TD double-click event, the following is the double-click event

function Fun_tevl (ele) {
Gets the parent node of the current node TR
var tr1 = Ele.parentNode.parentNode;
Gets the first child node of the parent node item
var B=tr1.cells[1].childnodes[0].value;
}

B is the value of the sibling node that gets

About the use of the sibling node in JS to view the current node

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.