Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nextab/5da9885406dc3b8433c05d3f20275288 to your computer and use it in GitHub Desktop.

Select an option

Save nextab/5da9885406dc3b8433c05d3f20275288 to your computer and use it in GitHub Desktop.
Innerhalb einer Sektion mit der Klasse .image-perspective-right werden automatisch alle p-Tags innerhalb des divs mit der Klasse .et_pb_text_inner um span-Tags mit der Klasse .inner erweitert.
let highlightText = document.querySelectorAll('.image-perspective-right');
for(let i=0; i<highlightText.length; i++){
let textToWrap = highlightText[i].querySelectorAll('.et_pb_text_inner p');
console.log(textToWrap);
for (let j=0; j<textToWrap.length; j++) {
textToWrap[j].innerHTML = '<span class="inner">' + textToWrap[j].innerHTML + '</span>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment