hi,
can I remove with jQuery only the text in a node but not the children elements ?
thanks
hi,
can I remove with jQuery only the text in a node but not the children elements ?
thanks
Here's my idea:
function removeText(element){
var newElement = $('<' + element[0].nodeName + '/>');
element.children().each(function(){
newElement.append(this);
});
element.replaceWith(newElement);
}