JQuery 分割字符串php
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鳥教程(runoob.com)</title> <script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ var arr = 'google,stackoverflow,JavaWorld'; var strArray = arr.split(','); for(var i in strArray){ alert(strArray[i]); } }); }); </script> </head> <body> <h3></h3> <button>點我</button> </body> </html>
菜鳥教程在線測試網址:html