Harugawa Harugawa - 4 months ago 4x
Javascript Question

Finding a certain number in html and replace it with custom text

So, I have a table and there is a colum called value with different numbers that varies from 0 to 2.


Yes, I know that something like does not exist, it was just for sake of example.
But the real question is, how can I with help of jquery find those numbers and replace it with something else.. for example

if(td == 1){
replace 1 with "Hello"


Use contains() to get td which have similar text and replace text using .text()

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>