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>This example will work only on Firefox</p> <p>Click on the following button to find the name(title) of last enabled stylesheet of this document.</p> <button onclick="myFunction()">Click Me</button> <p id="point"></p> <script> var x = document.getElementById("point"); //try to change "green" to "red document.selectedStyleSheetSet = "green"; function myFunction(){ x.innerHTML = document.lastStyleSheetSet; } </script> </body> </html>
OUTPUT
×

Save as Private