How to implement following for the current .packages if I have multiple having .packages class?
$('.packages').each(function(){
var sizeOfLi = $(".packages:last > li").width();
});
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
mapfunction iterates over the jQuery collection and calls the function provided in the argument, withthisset to the current element. It will collect all the return values inan arraya jQuery collection (see comments). If you want an array, add.get()to the end of the above.Inside the function, need to re-wrap
thisas a jQuery element so we can use the jQuery’s.width(), sincethisis a bare DOM element.