Search code examples
javahtmlweb-applications

How to get ID Parameter in url also in java


How to get ID Parameter in my url

https://example.com/?id=8281

how to get id= value in html

GET ID IN URL

also anyone tell for applications


Solution

  • What you are looking for is called a query parameter, you can get it with plain javascript like this.

    const urlParams = new URLSearchParams(window.location.search);
    const myParam = urlParams.get('myParam');
    

    reference -> How can I get query string values in JavaScript?