vd1
RUN
<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 kiểm tra học sinh có đủ điểm đỗ không.</p> <button onclick="myFunction()">Kiểm tra</button> <p id="demo"></p> <script> var scores = [9, 4, 8, 8]; document.getElementById("demo").innerHTML = scores; function checkScore(scores) { return scores <= 5; } function myFunction() { document.getElementById("demo").innerHTML = scores.findIndex(checkScore); } </script> </body> </html>
PHÓNG TO