خرید بک لینک

Vote count: -1

$(document).ready(function ($) {


    var err = $('.velkoobchod-category').find('.error').length;

    // this retus valid number
    alert(err);      

    if(err>0) {

      $('.velkoobchod-category .product-container > div').each(function() {

        var prod_count = $(this).find('.product-wrapper').lenght;
        alert(prod_count); // this retus undefined

      });
    }

});

In this code I am using jQuery to find a count of html elements. In the first case: var err = $('.velkoobchod-category').find('.error').length; it retus a valid number.

In second case var prod_count = $(this).find('.product-wrapper').lenght; it retus undefined even if there are exactly 3 elements with .product-wrapper class. Why is that?

asked 4 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 28 ارديبهشت 1395 ساعت: 23:29

صفحه بندی