A way to add a new line of information about jquery. button to add

Source: Internet
Author: User

This problem has been tinkering for almost two days and is worth documenting

The first method, I chose the direct

var td= $ (' TD '). Text

Direct selection of all TD definition, too simple, using the console controller to print out TD to find the numbers are all together, this is a very irrational way

The second method, I used the children method, according to table TR TD First-class search, but the method is too troublesome, choose to give up

The third method, the direct find found, print out the console found just to find the TD, the content is not resolved

var $table = $ ("table");         var td = $table. FIND ("TD")        Console.log (TD);         if (Td.length >) {         $ ("<br><br/>"). AppendTo ("TD");                  return false;

Fourth time method,

$ (document). Ready (function() {         var$table = $ ("table"); varTD = $table. FIND ("TD")        vartt = $ ("TD"). Val ();       Console.log (TT); $(' Table TD '). each (function() {Console.log ($ ( This). text ()); if($ (' table TD '). TEXT () > 30) {alert (' Fev ')         $("<br><br/>"). AppendTo (' table TD '). text (); return false; }        Else {                        $(' TD '). Val (""); return true; }         })    });

Print out the value of TD, but with <br> modified TD line, the value is not changed

The fifth time method, directly change the CSS.

td{width:18% ;        Word-break break-all;}

Toss half a day, really black humor

A way to add a new line of information about jquery. button to add

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.