$(function(){
$(".link").each(function(){
var spany =$('span').size();
var word = $('.button').text().length;
var a = 5;
if(a > word){
$("#control").append("small");
} else {
$("#control").append("big");
}
});
return false;
});
I have a problem with jquery and its each function. each does not run.
In my example I have second span 5 word (big) but first span 4 word (not big).
I want output 1.span small, 2.span big. How can I fix my code to get this?
just try this:
i hope this would help