O
O
offsiderst2021-07-10 14:40:48
JavaScript
offsiderst, 2021-07-10 14:40:48

How to replace spaces with underscores?

https://jsfiddle.net/4nbz0pyj/1/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2021-07-10
@offsiderst

document.querySelectorAll("a").forEach((a) => a.innerHTML = a.innerHTML.replace(/\s/gi, "_"));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question