Access html element in media modal with jQuery

(function($){
//since only one label with data-setting='caption' exists, use this selector
    $("[data-setting=caption]").children('textarea').attr('required', true);
    })(jQuery);

I’m more curious as to how adding this would affect anything since these labels are not inside a <form> element?