Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Remove current label or input field in jquery

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 464
    Comment on it

    Hello,

    I am writing the code through which we can remove particular label or input field on the click of delete button.It is mostly used when we have three or more forms user interface in our page.

    To execute the piece of code please add jquery libraries from jquery.org

    function remove_chk(thisObj) {
        var thisObj = $(thisObj);
        var prevBox = thisObj.prev('label');
        var prevInput = prevBox.prev('input');
        var prevDiv = prevInput.parent();
        var hr = prevDiv.next('hr');
    
        hr.remove();
        prevDiv.remove();
        prevBox.remove();
        prevInput.remove();
        thisObj.remove();
    }
    

    Similarly with the help of this code you can remove any html tag. Cheers..

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: