I have the following example:
<input type="text" class="input1" value="bla"/>
Is there a way to check if this element exists and has a value in one statement? Or, at least, anything shorter then
if($('.input1').length > 0 && $('input1').val() != '')
只是在一英里长的条件下感到沮丧.