JavaScript Reference/Javascript Properties/self

Материал из Web эксперт
Перейти к: навигация, поиск

"self" Example

   <source lang="javascript">
   

<html> <body id="myBody" bottommargin=150> <script language="JavaScript">

   function function1() {
       alert(window.self.myBody.bottomMargin);
   }

</script> <input type="button" value="Bottom Margin" onclick="function1();"> </body> </html>


     </source>
   
  


"self" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<frame> window | +----------------+--------------------------------------------------------------+

     </source>
   
  


"self" Syntax and Note

   <source lang="javascript">

Note: Read-only property. Returns a reference to the current active window or frame.

Syntax:

window.self document.all.frameID.self // IE only


     </source>