Answer the question
In order to leave comments, you need to log in
How to find a word in a div block and give it a class, using JS, which is written in capital LETTERS?
How to find a word in a div block and give it a class, using JS, which is written in capital LETTERS?
for example
<div class="block">
<h1>СЛОВО большими буквами</h1>
</div>
Answer the question
In order to leave comments, you need to log in
How to find a word in a div and give it a class...
block.innerHTML = block.innerHTML.replace(/([А-Я]+)/g, '<span class="здесь-ваш-класс">$1</span>');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question