Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Window Location Object</h1>
<h2>The search Property</h2>
<p><a id="w3s" href="https://www.w3schools.com/?answer=yes">
https://www.w3schools.com/?answer=yes</a></p>
<p id="demo"></p>
<script>
let anchor = document.getElementById("w3s");
let query = anchor.search;
document.getElementById("demo").innerHTML = "The query portion of the URL is: " + query;
</script>
</body>
</html>