JavaScript Reference/Javascript Properties/port

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

"port" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript">

   function function1() {
       alert(document.getElementById("myLink").port);
   }

</script> <a id="myLink" href="http://www.wbex.ru" target="_blank">wbex.ru home page</a> <input type="Button" value="Port Number" onClick="function1();"> </body> </html>


     </source>
   
  


"port" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <area> | | |location | +----------------+--------------------------------------------------------------+

     </source>
   
  


"port" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Specifies the URL port number.

Syntax:

document.getElementById("elementID").port = value document.all.elementID.port = value // IE only location.port = value


     </source>