What do you want to save?
Add Code snippet
New code examples
-
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 -
Javascript 2021-11-03 08:30:11
create css class js
var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.cssClass { color: #F00; }'; document.getElementsByTagName('head')[0].appendChild(style); document.getElementById('someElementId').className = 'cssClass'; Add solution
Best helpers
Holyeyeolo
+5
Auntkym
+5
Mostafa 36a2
+5
RoToRa
+5
Rodrigorgs
+5
Matt2507864
+5
Arnav Bose
+5
Waldrumpus
+5
TheShade
+5
Naigel
+5
Rev1.0
+5
Babak
+5
Ohhh
+5
Jeff Sours
+5
Jim Mourgos
+5
J. Marks
+5
Piquet
+5