I have
<input type="text" class="required" value="XXX" name="abc">
<input type="hidden" class="required" value="XXX" name="abcd">
<input type="text" class="required" value="XXX" name="abcef">
i have many input fields like this.
i need a jQuery selector where i can select a text field whose class is required
right now to select textfield i use $(':input[type="text"]')
how do i also put a condition to select class="required."
EDIT
so say now i have the following input fields
<div id="validate_info">
<input type="text" class="required" value="XXX" name="abc">
<input type="hidden" class="required" value="XXX" name="abcd">
<input type="text" class="required" value="XXX" name="abcef">
<input type="password" class="required" value="XXX" name="abcefg">
<input type="text" value="XXX" name="abcefgsa">
<input type="password" value="XXX" name="abcsaefg">
</div>
i need one selector that can select all type="text", type="password" which has class="required" i tried
$('#validate_info $("input.required").filter("[type="password"],[type="text"]")');
but this doesnt seem to work.
$("input.required").filter("[type="password"],[type="text"]")is not a selector string. It should be$("#validate_info input.required").filter("[type='password'],[type='text']")or$("input.required", "#validate_info").filter("[type='password'],[type='"text']"). Also, make sure you use the right quotes inside quotes.