document.implementation example
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style type="text/css"> #result{ color: red; font-size: 20px; font-weight: bold; } </style> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <p>Click để kiểm tra xem trang hiện tại có đặc tính HTML DOM 1.0 hay không</p> <p id="result"></p> <button onclick="myFunction()">Xem kết quả</button> <script> function myFunction() { var imp = document.implementation; var result = imp.hasFeature("HTML", "1.0") ? "Có" : "Không"; document.getElementById("result").innerHTML = result; } </script> </body> </html>
PHÓNG TO