codingtcher.com
Theme Night
Home
Login

jquery add selected attribute

Home » Tutorial Post » jquery add selected attribute
//add attribute selected jquery
$(document).on('change', 'select', function () {
            var value = $(this).val();
            $(this).find('option[value="' + value + '"]').attr("selected", "selected");
});

Related Post