Returns the href for linked stylesheets
Description
href
returns the href for linked stylesheets.
Example
<!DOCTYPE HTML>
<html>
<head>
<style title="core styles">
p {<!-- w ww . j a va 2 s .c o m-->
border: medium double black;
background-color: lightgray;
}
#block1 {
color: white;
}
</style>
<link rel="stylesheet" type="text/css" href="styles.css" />
<style media="screen AND (min-width:500px)" type="text/css">
#block2 {
color: yellow;
font-style: italic
}
</style>
</head>
<body>
<p id="block1">This is a test.</p>
<p id="block2">This is a test.</p>
<div id="placeholder" />
<script>
var placeholder = document.getElementById("placeholder");
var sheets = document.styleSheets;
for ( var i = 0; i < sheets.length; i++) {
var newElem = document.createElement("table");
newElem.setAttribute("border", "1");
newElem.innerHTML += "<tr><td>href:</td><td>" + sheets[i].href + "</td></tr>";
placeholder.appendChild(newElem);
}
function addRow(elem, header, value) {
}
</script>
</body>
</html>