Link.search

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							link.search

Description

The search property of the Link object represents the query portion of the URL (if available). This includes the leading question mark (?).

Example

Listing 7.376 shows how the search property can be determined. When the button is clicked, the showsearch() function displays the search value of the link.

Listing 7.376 Example of the search Property
<html>
<head>
<title> Using the search property of the Link object</title>
</head>
<body>

<script language="JavaScript">
<!--Hide

// display the information being queried
function showsearch(){
     document.form1.text1.value = document.links[0].search;
}
// End Hide --->
</script>
							 Click the button to ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.