jquery Get Tabular Data sample code _jquery

Source: Internet
Author: User
There is such a table:


Click Delete Execution save and need to perform onclick event SaveItem ("<% #Eval (" ID ") >", this);

In JS
Copy Code code as follows:
function SaveItem (id,btn)
{
var tbl = $ (BTN). Parent (). Parent (). Par ENT ();

//table The second line of Records

var dj = Tbl.children (). EQ (1). Chilren (). EQ (3). Find ("INPUT"). attr ("value");//find method would have returned Back to an array, but here's an element that can be written like this. If you have more than one element, determine specifically that an element can be selected through the selector used by jquery to confirm or use an enumeration: in Find ("INPUT"). each (function (i) {

//alert ($ (this). attr (" Value "));

//Assignment

$ (this). attr ("value", "Your_value");

})
var content=tbl.children (). EQ (2). Children (). EQ (1). Find ("TEXTAREA"). Text (); The contents of the text box for the third row of the third column. If you use the asp.net asp.net textbox control and it is a multiline pattern here tagname is ' TEXTAREA ', using the attr ("value") method or directly using the text () method to get the value.

var mark = Tbl.children (). EQ (3). Children (), EQ (1). Find ("INPUT"). attr ("value"); this gets the value of the third column in line fourth.

}

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.