Javascript examples for jQuery Method and Property:html
Convert Html table to CSV via jQuery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.10.1.js"></script> <script type="text/javascript"> $(window).load(function(){//from ww w . java2 s. co m var csv = 'testing,testing,testing'; var csvData = 'data:application/csv;charset=utf-8,' + csv; var filename = 'test.csv'; $('.link').attr({ 'download': filename, 'href': csvData, 'target': '_blank' }); }); </script> </head> <body> <a class="link">Test</a> </body> </html>