JavaScript Reference/Javascript Properties/owningElement
Версия от 21:30, 25 мая 2010; (обсуждение)
"owningElement" Example
<source lang="javascript">
<html> <body> <style id="myS">
- myP1 {
color:red;
}
- myP2 {
color:green;
} </style>
text.
text.
<input type="button" value="owningElement" onclick="function1();"> <script language="JavaScript">
function function1() { var m = document.styleSheets[0].owningElement.id; alert(m); }
</script>
</source>
"owningElement" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |styleSheet | +----------------+--------------------------------------------------------------+
</source>
"owningElement" Syntax and Note
<source lang="javascript">
Note: Read-only property. Returns a reference the styleSheet.
Syntax:
document.styleSheets[index].owningElement
</source>