<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="js/jquery-1.7.1.min.js"></script> </head> <body> <ul> <li>number1</li> <li>number2</li> <li>number3</li> <li>number4</li> <li>number5</li> <li>number6</li> </ul> <script> $('li').each(function(i,el) { el = $(el); alert(i); alert(el.text()); }); </script> </body> </html>
为什么要用el = $(el);
直接用el.text()确实不行,我想知道原因
田心枫
慕的地6079101
高jay
高jay
相关分类