how to get a form search element from url javascript code example Example: javascript get url path window.location.pathname