Answer the question
In order to leave comments, you need to log in
How to replace space with br?
<span class="wfw">a little bit</span>
Link to the script
How to make it so that instead of a space it turns out<br/>
a
little
bit
Answer the question
In order to leave comments, you need to log in
output = input.replace(' ','<br>'); // (remove spaces from < br >)
We study this: https://learn.javascript.ru/document
then, using document.getElementsByClassName or document.querySelectorAll, we select the necessary elements, iterate over them and make a replacement using replace or split / join.
For $ 10 I will save you from having to read a multi-book caf)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question