What do you want to save?
Add Code snippet
New code examples
-
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 -
Javascript 2021-11-05 15:13:15
how to check if website is down javascript
function isSiteOnline(url,callback) { // try to load favicon var timer = setTimeout(function(){ // timeout after 5 seconds callback(false); },5000) var img = document.createElement("img"); img.onload = functi... Add solution -
Javascript 2021-11-05 02:40:09
javascript remove html from text
//remove html tags from a string, leaving only the inner text function removeHTML(str){ var tmp = document.createElement("DIV"); tmp.innerHTML = str; return tmp.textContent || tmp.innerText || ""; } var html = "... Add solution -
Other 2021-11-04 21:11:14
mailchimp popup by click
<script id="mcjs"> function showPopup() { !function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connec... Add solution
Best helpers
Holyeyeolo
+5
Auntkym
+5
Mostafa 36a2
+5
RoToRa
+5
Rodrigorgs
+5
Matt2507864
+5
Nick Vaccaro
+5
Arnav Bose
+5
Waldrumpus
+5
TheShade
+5
Naigel
+5
A10ciod
+5
Rev1.0
+5
Babak
+5
Ohhh
+5
Jeff Sours
+5
Jim Mourgos
+5
J. Marks
+5
Piquet
+5