Javascript examples for DOM HTML Element:Link
The disabled property sets or gets whether the linked document is disabled.
This property is currently only used with style sheet links.
Set the disabled property with the following Values
Value | Description |
---|---|
true|false | Sets whether the linked document is disabled |
A Boolean, returns true if the linked document is disabled, otherwise it returns false
The following code shows how to disable the linked document:
<!DOCTYPE html> <html> <head> <link id="myLink" rel="stylesheet" type="text/css" href="http://java2s.com/style/bootstrap.min.css"> </head>/*from ww w. j a v a 2 s.co m*/ <body> <h1>I am formatted with a linked style sheet</h1> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myLink").disabled = true; } </script> </body> </html>