D
D
Danila2021-07-05 17:44:47
JavaScript
Danila, 2021-07-05 17:44:47

How to pass text from the address bar to a variable?

You need to get the text from the address bar https://localhost/#2021. How to get 2021?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Makarov, 2021-07-05
@FunnyDev

window.location.hash will get #2021 and window.location.hash.substring(1) method will get 2021

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question