I have a question regarding the selector.
I want to select the input field that is not under certain class.
My html
<div class='test'>
……
<input type='text'></input>
// more input field
<div class='nonTarget>
<input type='text' ></input>
<div>
</div>
I want to input field under test class but not nonTarget div.
I have
var test = $('.test :not(.answer) input');
test.each(function(){
console.log($(this).val())
})
but it seems select every input fields.. Can anyone help me about it? Thanks a lot!