Take the 2-minute tour ×  This question is similar, but doesn't
highlight any possibilities to export the data. Thoughts?
share|improve this question  2 Answers 2  up vote 24 down vote
accepted  I think you're misunderstanding the answer to the
question you linked to, it's suggesting you use a Data URI for
export.  Excel is a bit of a complicated target to aim for as
the file format is itself binary (or OOXML). If you just want
something that opens in Excel then you can export the more
straightforward CSV as a data URI. The following code is a bit
rough and ready and has only been tested in Firefox:  function
exportData() {     var data = '';     for (var i=1;i<=2;i++) {
var sep = '';         for (var j=1;j<=4;j++) {             data
+=  sep + document.getElementById(i + '_' + j).value;
sep = ',';         data += '\r\n';     var exportLink =
document.createElement('a');     exportLink.setAttribute('href',
'data:text/csv;base64,' + window.btoa(data));  Here's the page
markup:  <input type=