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)