אתחול:
let nodes = document.querySelectorAll('.text-line');
nodes.forEach(node =>
node.dataset.prevText = node.textContent
.replace(/[\u0591-\u05BD\u05BF-\u05C7]/g,""))
בכל החלפה:
nodes
.forEach(function(node) {
var prevText = node.dataset.prevText;
var currentText = node.textContent;
node.textContent = prevText;
node.dataset.prevText = currentText;
});
עשיתי את זה על הselector של תא שמע, אתה יכול להחליף לאיזה selector שאתה צריך.