0
I want to change the text inside the <p>
but without Jquery query class or ID only the text.
I tried to do something with this but it consults the class on <p>
$('p.text').contents().filter(function() {
return this.nodeType == 3
}).each(function(){
this.textContent = this.textContent.replace($.trim($('p.text').text()),'Forte Max');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p class="text">Forte '.$N.'</p>
How do I use the <p>Forte '.$N.'</p>
the final number is Forte 15
Then I would like Jquery to identify Text and switch to Forte Max
Where it comes from
$N
? It was not easier to change the logic that assigns the value or print of this?– tvdias
Yes I’ve tried it but it didn’t work, the $N is the numbering of each level assigned to the item. For example I could go to Fort 15 and change to Max but it’s with numbering so I wanted to do it another way.
– Jor