vd1
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <p>Click vào button in mảng.</p> <button onclick="numbers.forEach(myFunction)">In</button> <p id="demo"></p> <script> demoP = document.getElementById("demo"); var numbers = [4, 9, 16, 25]; function myFunction(item, index) { demoP.innerHTML = demoP.innerHTML + "index[" + index + "]: " + item + "<br>"; } </script> </body> </html>
PHÓNG TO