What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-14 04:43:06
document.createElement('iframe');
var ifrm = document.createElement('iframe'); ifrm.setAttribute('id', 'ifrm'); // assign an id //document.body.appendChild(ifrm); // to place at end of document // to place before another page element var el = document.getElementById('marker'); el.parent... Add solution -
Javascript 2021-10-13 00:28:05
youtube iframe api get current time
var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYou... Add solution -
Javascript 2021-10-11 20:12:11
How to insert an element after another element in JavaScript without using a library
//insert new Element after some reference Element function insertAfter(newElement, referenceElement) { referenceElement.parentNode.insertBefore(newElement, referenceElement.nextSibling); } //example usage var newElement = document.createElement... Add solution -
Javascript 2021-10-07 22:41:09
How to insert an element after another element in JavaScript without using a library?
//insert new Element after some reference Element function insertAfter(newElement, referenceElement) { referenceElement.parentNode.insertBefore(newElement, referenceElement.nextSibling); } //example usage var newElement = document.createElement... Add solution -
Javascript 2021-09-29 23:47:03
GTM
// REPLACE GTM-1234567 with your GTM ID // REPLACE GTM-1234567 with your GTM ID // REPLACE GTM-1234567 with your GTM ID // Paste this code as high in the <head> of the page as possible: <!-- Google Tag Manager --> <script>(function(w,d,... Add solution -
Javascript 2021-09-20 11:16:03
javascript create div in div
document.body.onload = addElement; function addElement () { // create a new div element const newDiv = document.createElement("div"); // and give it some content const newContent = document.createTextNode("Hi there and greetings!&... Add solution