+88 01797-506292

Post Date: September 11, 2017
Posted By: admin
//create slug
    jQuery('#name').keyup(function(){
        jQuery('#slug').val(slug(jQuery('#name').val()));
    });

    var slug = function(str) {
        var $slug = '';
        var trimmed = jQuery.trim(str);
        $slug = trimmed.replace(/[^a-z0-9-]/gi, '-').
        replace(/-+/g, '-').
        replace(/^-|-$/g, '');
        return $slug.toLowerCase();
    }

2 responses to “Create Slug in JS”

  1. SusanNor says:

    Пишите на почту: bernsontraff@gmail.com

    Все предложения по услуге Кредитные карты Аэрофлот в банках Большой Тарловки на выгодных условиях

    http://kredit.bestsky.info/

  2. admin says:

    Could you please ask in English.
    We are not familiar in your language.

    Thanks for your comment

Leave a Reply

Your email address will not be published. Required fields are marked *