You can simply use the following selector, which makes use of :input
(which will also select <button>
s, you can switch back to input,textarea,select
and filter
if that's not desired):
$('#a :input:visible[required]');
Replace #a
with whatever div you want to filter on.
If the elements need to be right under the div, you can use #a > :input:visible[required]
instead.
Demo:
var $required = $('#a :input:visible[required]');
// Just to showcase what this selector matches
$required.css('background-color', 'red');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="a">
<p>A1: <input type="text" required></p>
<p>A2: <textarea required></textarea></p>
<p>A3: <select required><option>option1</option></select></p>
<p>A4 (hidden, won't be matched): <input type="text" style="display:none" required></p>
</div>
<div id="b">
<p>B1: <input type="text" required></p>
<p>B2: <input type="text" required></p>
</div>