Click here to Skip to main content
15,867,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
Below is my code for image is present in html table cell or not.If yes,I want to change the color of row to green otherwise red.....
Thanks,

C#
function getEtd(){
var count='0';
var TDs=document.getElementsByTagName('td')
var length=TDs.length;

i='0';


while(i<length){
if(TDs[i].innerHTML=='<img src=" />'){
 // alert(TDs[i].innerHTML);
count++;
}
i++;
}
alert('there are '+count+' Image td\'s');
}
Posted
Comments
Kornfeld Eliyahu Peter 23-Jul-14 2:48am    
And what the problem is?
Dev Sharma 23-Jul-14 2:53am    
Problem is not detecting images in the table....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900