日期:2014-05-16 浏览次数:20483 次
<html> <head> <title>jquery</title> <script type="text/javascript" src="jquery.min.js"></script> <style> </style> <script type="text/javascript"> $(document).ready(function() { var list = ['landy','lander','wade','kobe','jimmy']; $('p').html(list.sort().join("<br/>")); }); </script> </head> <body> <p></p> </body> </html>
<html> <head> <title>jquery</title> <script type="text/javascript" src="jquery.min.js"></script> <style> </style> <script type="text/javascript"> $(document).ready(function() { var list = [1,2,12,43,5,64,7]; $('p').html(list.sort().join("<br/>")); }); </script> </head> <body> <p></p> </body> </html>
<html> <head> <title>jquery</title> <script type="text/javascript" src="jquery.min.js"></script> <style> </style> <script type="text/javascript"> $(document).ready(function() { var list = [1,2,12,43,5,64,7]; $('p').html(list.sort(function(a,b){ return a-b; }).join("<br/>")); }); </script> </head> <body> <p></p> </body> </html>