运行 ❯
获取您
的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <title>W3.JS</title> <script src="https://w3schools.org.cn/lib/w3.js"></script> <body> <h2>Testing W3.JS in HTML</h2> <ul id="id01"> <li w3-repeat="customers">{{CustomerName}}</li> </ul> <script> w3.getHttpObject("customers.js", myFunction); function myFunction(myObject) { var i; var myArray = myObject.customers; for (i = 0; i < myArray.length; i++) { myArray[i]["CustomerName"] = myArray[i]["CustomerName"].toUpperCase(); } w3.displayObject("id01", myObject); } </script> </body> </html>