HTML-button, div-Inhalt mit javascript

Brauche ich zum speichern des Inhalts des div mit reinem javascript.
Ich habe gerade bearbeitete eine Geige, aber ich Schaffe es nicht funktioniert 🙁

jsfiddle

<div id="content">
<h1>Hello world</h1>
<i>Hi everybody</i>

Download

function download(){
    var a = document.body.appendChild(
        document.createElement("a")
    );
    a.download = "export.html";
    a.href = "data:text/html," + document.getElementById("content");
}

InformationsquelleAutor nosmoke | 2015-04-17

Schreibe einen Kommentar