The use of the each function of jquery

Source: Internet
Author: User

Tags: head read span pre color case Map ONS ext

<! DOCTYPE html><html lang= "en" ><head> <meta charset= "UTF-8" > <title>each and Map functions use case </ti tle> <script src= "Jquery-1.11.3.min.js" ></script> <script>jQuery (document). Ready (function ($) {//$ ("Li"). each (function (index, EL) {//var origintxt = $ (EL). Text (); //$ (EL). Text (origintxt + index); // });$.each ($ ("Li"), function (I, e) {var origintxt=$ (E). text (); $ (E). Text (Origintxt+ i+1);            }); //map function: Will put all the//The global map function parameter is reversed with the parameters of the jquery object. var temp = $.map ($ ("Li"), function (Elme, index) {returnindex;            }); var temp2= $ ("li"). Map (function (i, E) {console.log (i); returni;        });    }); </script></head><body> <ul> <li> Good times </li> <li> good Times </li> <li> Good times </li> <li> good Times </li> </ul></body></html>

The use of the each function of jquery

Related Article

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: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: