문제

I have this function

function val_form (e) {
    event.preventDefault();
    e = e || window.event;
    e = e.target || e.srcElement;
    var myID = e.id;
    //alert(myID);
    $.post($('#'+myID).attr('action'), $('#'+myID).serialize(), function( data ) {
        if(data.st == 0 || !data.st)
        {
            $('#'+myID).childern('.vlad_error').html(data.msg);
        }

        if(data.st == 1)
        {
            $('#'+myID).childern('.vlad_error').html(data.msg);
        }
        //alert(data.msg);

    }, 'json');
    return false;   
}

I want to select the child .vlad_error of this form only , not all the page. How can this be done please?

도움이 되었습니까?

해결책

You can use selector which means child of what is left to that space.

Like this:

$('form .vlad_erro');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top