I want to use (base64 encoded key) as URL parameter
like: mydomain.com/?key=cHVyY2hhc2VwcmljZT0zNCQ=
that returns: purchaseprice=34$
I read How to get base64 encoded... but it did not help.
here is my working code without base64:
<input type="text" id="price" />
<script>
const url = new URL(window.location);
document.querySelector('#price').value = url.searchParams.get('purchaseprice');
</script>