D
D
damarkuzz2020-05-04 14:16:21
JavaScript
damarkuzz, 2020-05-04 14:16:21

How to insert the last part of a link in href?

Let's say we're on a page whose address is yandex.ru/maps/moscow/search

How to take the last piece /searchand paste it into
<input value="/something/(вставить_сюда)">?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2020-05-04
@miraage

"yandex.ru/maps/moscow/search".split("/").pop()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question