javascript - Using jquery to find the number of characters in img src -


i have image slider:

<ul class="slider">   <li><img src=""></li>   <li><img src=""></li>   <li><img src=""></li> </ul> 

if length of characters <=41 , want remove li tag. tried following code not working

var li = $(".slider ul > li"); var $img = $(".slider > ul > li img").attr("src"); if ($img == length(41)) {     li.parentnode.removechild(li); } 

this snippet it:

$(".slider > ul > li img").filter(function(){   return $(this).attr('src').length <= 41; }).closest('li').remove(); 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -