Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,
Please help me Im new to jquery....
Posted
Comments
Mohibur Rashid 23-Jul-14 3:36am    
You specifically asked for jQuery. But I will answer you this in javascript.
var imgCount=cell.querySelectorAll("IMG").length;
//another
var imgCount=cell.getElementsByTagName("IMG").length;

1 solution

http://api.jquery.com/category/selectors/[^] explains all the options to select elements with jQuery...
For your case $("td img") will select all the img elements that are inside a td element, anywhere in your page...
 
Share this answer
 
Comments
Dev Sharma 23-Jul-14 3:13am    
Please,write some sample code....
Kornfeld Eliyahu Peter 23-Jul-14 3:14am    
Of what? Bring forward your code and I may advise you how to fix it!
Dev Sharma 23-Jul-14 3:32am    
http://www.codeproject.com/Questions/799761/How-to-know-whether-image-is-present-in-html-table?arn=0
Above is link where im trying to do with javascript..Please,help me to do this jquery...
Dev Sharma 23-Jul-14 3:58am    
Hi,I have written upto this..I want rest of the non image containing rows will be displayed in red color...

$(document).ready(function(){
if($(":image"))
{
$( "tr" ).css( "color", "green" );
}
else
$( "tr" ).css( "color", "Red" );

});

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