javascript - Jquery not disabled the parent -
input tag not disabled.this code.please me.
var input = $('input[value="' + $(this).val() + '"]'); input.prop('disabled', true); input.parent('li').addclass('disabled');
you should use filter()
find input value instead of using attribute value selector.
reduce set of matched elements match selector or pass function's test.
also can use closest()
traverse desired parent.
script
var value = $(this).val(); var input = $('input').filter(function(){ return value == $(this).val(); }).prop('disabled', true); input.closest('li').addclass('disabled');
Comments
Post a Comment