JavaScript Reference/Javascript Properties/search

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

"search" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript"> function function1() {

   alert(document.getElementById("myA").search);

} </script> <a id="myA"

  href="http://www.wbex.ru?index"
  target="_blank">wbex.ru Site</a>

<input type="Button" id="myB" value="Wescom Advocar" onClick="function1();"> </body> </html>


     </source>
   
  


"search" is applied to

   <source lang="javascript">

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

     </source>
   
  


"search" Syntax and Note

   <source lang="javascript">

Note: Read and write property. When a question mark (?) exists in a URL, this property specifies the string that follows the question mark.

Syntax:

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


     </source>