Alright so i am trying to change the width of a parent element but selector parent element is just not working for me. When i do element.parent() it works just fine but when I do element.parent(‘#group’) it doesnt work at all. My current code:
$(document).on('change', '#range-element input', function() {
var range_value = $(this).val() + '%';
$(this).parent('#group-element').css( "width", range_value );
});
.parent()
will only go up one level and will not find ancestors past that. Try $(this).closest('#group-element')
Thanks for the help John!