This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

search

Summary

Sets or retrieves the substring of the href property that follows the question mark.

Property of dom/Locationdom/Location

Syntax

var queryString = location.search;
location.search = queryString;

Return Value

Returns an object of type StringString

The query string component of the URL.

Examples

This example function returns the search property of the current page location.

function getSearch() {
    return document.location.search;
}

Notes

The substring that follows the question mark is the query string or form data.

Attributions