You can use jquery for creating the element. It will work on both the browsers
$(document).on('click', '#test', function (event) {
var link = $("", {
"download": "test.xls",
"href": "data:application/vnd.ms-excel;utf-8,test"
});
$("#test").append(link);
link.get(0).click();
});
Fiddle