Skip to content

Instantly share code, notes, and snippets.

@carlosipe
Created May 24, 2017 19:03
Show Gist options
  • Save carlosipe/f45d7c6700b0c18783effb1e1bb99582 to your computer and use it in GitHub Desktop.
Save carlosipe/f45d7c6700b0c18783effb1e1bb99582 to your computer and use it in GitHub Desktop.
var all = document.getElementsByTagName("*");
for (var i=0, max=all.length; i < max; i++) {
(all[i]).contentEditable = "true";
}
@carlosipe
Copy link
Author

var body = document.getElementsByTagName("body")[0];
body.contentEditable = "true";

@carlosipe
Copy link
Author

carlosipe commented May 24, 2017

var all = document.getElementsByTagName("img");
var urls = [
"http://blog.hdwallsource.com/wp-content/uploads/2015/01/italian-food-wallpaper-hd-44478-45604-hd-wallpapers.jpg",
"http://wallpapersdsc.net/wp-content/uploads/2016/09/Junk-Food-Desktop.jpg",
"https://tse4.mm.bing.net/th?id=ORT.TH_470633631&pid=1.12&eid=G.470633631"
]
for (var i=0, max=all.length; i < max; i++) {
var rand = urls[Math.floor(Math.random() * urls.length)];
console.log( (all[i]).src = rand );
}

(all[0]).src = "http://www.hdiphone6wallpapers.net/iphone-6-backgrounds/iphone-6-wallpapers-1/iphone-6-wallpapers-hd-1912pahyd-1080x1920.jpg";

@carlosipe
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment