What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-21 23:51:50
javascript open new window and pass data
// Store the return of the `open` command in a variable var newWindow = window.open('http://www.mydomain.com'); // Access it using its variable newWindow.my_childs_special_setting = "Hello World"; //In the child (popup) window, you could acces... Add solution -
Javascript 2021-11-21 18:41:17
javscript insert element after another
//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-20 02:45:23
json.stringify file object return {}
// get File Object var fileObject = getFile(); // reCreate new Object and set File Data into it var newObject = { 'lastModified' : fileObject.lastModified, 'lastModifiedDate' : fileObject.lastModifiedDate, 'name' : fileObject.... Add solution -
Html 2021-11-19 01:43:08
how to make a to-do list in html
<!DOCTYPE html> <html> <head> <title>To-Do List App</title> <script> function addItem() { var newItem = document.createElement("div"); newItem.innerHTML = document.getElementById("box").va... Add solution -
Javascript 2021-11-18 05:19:17
js append html in div after
//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-17 12:20:20
how to get the next item in map() js
// The callback of map method accepts 3 arguments: // current item value; // current item index; // the array map was called upon. // So, you could use index to get next element value: var newArray = myArray.map(function(value, index, elements) { var... Add solution -
Javascript 2021-11-16 06:44:26
time in website
function display_c(){ var refresh=1000; // Refresh rate in milli seconds mytime=setTimeout('display_ct()',refresh) } function display_ct() { var CDate = new Date() var NewDate=CDate.toDateString(); NewDate = NewDate + " - " + CDate... Add solution -
Javascript 2021-11-13 07:29:11
save text of div to localStorage, update localStorage when text is changed
// get the text var text = $('#test').text(); // set the item in localStorage localStorage.setItem('test', text); // bind text to 'blur' event for div $('#test').on('blur', function() { // check the new text var newText = $(this).text(); /... Add solution