A query string is an optional part of a URL that goes after the file name and begins with a questionmark.
For eg the query string will be as
http://www.sitedemo/com/home.htm?newquerystringadded.
Here querystringvalue is the newquerystringadded.
The query string can be added and it can be retrieved as shown,
<div>
<input type=button value='AddQueryString'
onClick='self.location=
self.location.protocol+’//’
+self.location.host
+self.location.pathname+’?addquerystring’'>
<input type=button value='ShowQueryString'
onClick='alert(’Query string Value: ’+self.location.search)'>
</div>
Share with