Check for empty a field from all in jQuery
<p>I have four fields, and I the function to return true if atleast one field has a value, if all fields don't have a value return false, How do I do this?</p>

<p>My try:(this doesn't work like I want)</p>

<pre><code>function required_eachinput(){
    result = true;
    $('.myclass').each(function(){
        var $val = $(this).val();
        var ok = $val.each(function(){});
        alert(ok);
        if(!$val){
            $(this).css("background", "#ffc4c4");
            result = false;
        }
        $(this).keyup(function () {
            $(this).closest('form').find('input').css("background", "#FFFFEC");
        })
    });
        return result;
}
</code></pre>
