Picnic Website Code Tutorials

Hide div with URL query string and javascript

9/16/2013

View Demo

You put the query string at the end of the URL (?test=123). And use some JS to read the query string and then in this case hide the associated div.

HTML query string

<a href="query-string-demo.php?test=123">query string link</a>
		

Javascript

if (/123/.test(window.location.href)) {
	document.getElementById('hidediv').style.display = 'none';
}
		

Sponsors

Top Donators

Friends of Mine