javascript - remove a specific text from <td> element -


this question has answer here:

i remove specific set of characters div elements. contains dates time , i'd remove time part. here how try not working.

$("td").each(function( ) {             $(this).remove('12:00:00 am');          } 

any suggestion welcome. thanks.

tds=document.getelementsbytagname("td"); getelementsbytagname returns nodelist not array, not have foreach method on it.

you can natively writing following:

document.queryselectorall("td").foreach(function(currenttd) {    currenttd.innerhtml = currenttd.innerhtml.replace('12:00:00 am', ""); }); 

Comments