HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <link rel="stylesheet" title="red" type="text/css" href="/red.css"> <link rel="stylesheet" title="green" type="text/css" href="/green.css"> </head> <body> <p>Click on the button to count the number of styleSheets used in this document</p> <button onclick="myFunction()">Click Me</button> <p id="point"></p> <script> var x = document.getElementById("point"); function myFunction(){ x.innerHTML = document.styleSheets.length; } </script> <p><strong>Note</strong>: The CSS files used in the following examples are <a href="/red.css" target="_blank">red.css</a> and <a href="/green.css" target="_blank">green.css</a></p> </body> </html>
OUTPUT
×

Save as Private