EN
JavaScript - get search part from current URL
3
points
In this article, we would like to show you how to get the search part from the current URL in JavaScript.
Quick solution:
var currentSearch = location.search;
Simple explaination
When we call location.search
property it returns search part from currenly typed URL in the web browser address bar.