Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title> CSV demo</title>
- <script type='text/javascript'>//<![CDATA[
- window.onload=function(){
- var a = document.body.appendChild(
- document.createElement("a")
- );
- a.download = "export.csv";
- a.href = "data:text/csv;charset=utf-8," + document.getElementById("csv").innerHTML;
- a.innerHTML = "[Export conent]";
- }//]]>
- </script>
- </head>
- <body>
- <div id="content">
- <h1>Hello world</h1>
- <i>Hi everybody</i>
- </div>
- <pre id="csv" style="display:none">Year,Annual mean,5 year mean
- 1880,-0.31,
- 1881,-0.22,
- 1882,-0.28,-0.29
- 1883,-0.3,-0.29
- 1884,-0.33,-0.3
- 1885,-0.32,-0.32
- 1886,-0.29,-0.32
- 1887,-0.35,-0.28
- 1888,-0.28,-0.3
- 1889,-0.18,-0.3
- 1890,-0.4,-0.3
- 1891,-0.29,-0.31
- 1892,-0.33,-0.34
- 1893,-0.34,-0.32
- 1894,-0.35,-0.3
- 1895,-0.27,-0.26
- 1896,-0.19,-0.26
- 1897,-0.16,-0.22
- 1898,-0.3,-0.19
- 1899,-0.19,-0.19
- </pre>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment