開発環境 | メモ帳 |
実行環境 | Internet Explorer 11 |
<!doctype html>
<head>
<title>FileSave</title>
<script>
function download()
{
var element = document.getElementById("content");
var content = element.value;
var blob = new Blob([content]);
navigator.msSaveOrOpenBlob(blob, "FileSave.txt");
}
</script>
</head>
<body>
<textarea id="content" cols="40" rows="5">
hello, world
</textarea><br>
<button onclick="download()">download</button>
</body>