I need to save content of div using pure javascript. I just edited one fiddle but I can\'t make it works :(
jsfiddle
In jsfiddle, you can't run a javascript function inside of html events (like onClick) unless the javascript is contained in tags. (nevermind this)
Try this:
HTML
Hello world
Hi everybody
JS
var download_button = document.getElementById('download');
download_button.onclick = download;
function download(){
var content = document.getElementById('content')
console.log(content);
}
updated jsfiddle