What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-07 18:14:01
first child element javascript
Both these will give you the first child node: console.log(parentElement.firstChild); // or console.log(parentElement.childNodes[0]); If you need the first child that is an element node then use: console.log(parentElement.children[0]); Add solution -
Javascript 2021-08-31 18:12:01
replace all swear words using bookmarklet
javascript:function htmlreplace(a,b,element){if(!element)element=document.body;var nodes=element.childNodes;for(var n=0;n<nodes.length;n++){if(nodes[n].nodeType==Node.TEXT_NODE){nodes[n].textContent=nodes[n].textContent.replace(new RegExp(a,'gi'),b);}e... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5