Skip to content Skip to sidebar Skip to footer

Remove Dom Text From Variable With Jquery

I need to Remove this First Name : ONLY. I have already assign it to a variable. how to remove only that from DOM. example: First Name :

Solution 1:

You can use removeChild() method like

var node = document.getElementById('firstName')['previousSibling'],
    label = node.nodeValue;
node.parentNode.removeChild(node);

Demo: Fiddle

Post a Comment for "Remove Dom Text From Variable With Jquery"