What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-08 14:53:34
load youtube iframe player api
// This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.... Add solution -
Javascript 2021-11-08 11:49:16
javascript insert sibling after
<!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> var tempDiv = document.createElement('div'); paragraph.insertAdjacentElement('afterend', tempDiv); // inserted div after... Add solution -
Javascript 2021-11-07 17:32:17
js create 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 -
Javascript 2021-11-07 04:02:15
measure width in px chrome extension
var fromX, fromY; var svg = document.createElementNS ('http://www.w3.org/2000/svg',"svg"); svg.setAttribute("style", "position: absolute; top:0;left:0;height: " + document.body.clientHeight + "px;width: 100%"); var ... Add solution -
Javascript 2021-11-06 22:58:15
insert element after element javascript
//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-11-06 22:48:09
live search using fetch api
const search_input = document.getElementById('search'); const results = document.getElementById('results'); let search_term = ''; let countries; const fetchCountries = async () => { countries = await fetch( 'https://restcountries.eu/rest/... Add solution
Best helpers
Arnav Bose
+5
Thepace
+5
Nick Vaccaro
+5
Matt2507864
+5
Rodrigorgs
+5
Elai Mateo
+5
RoToRa
+5
Newbie
+5
Mostafa 36a2
+5
Amalloy
+5
Auntkym
+5
Rev1.0
+5
Piquet
+5
J. Marks
+5
Jim Mourgos
+5
Jeff Sours
+5
Ohhh
+5
Babak
+5
Naigel
+5
Catimann
+5
A10ciod
+5
Holyeyeolo
+5
TheShade
+5
Waldrumpus
+5