Cosi recuperi i valori di ogni input presente nella pagina:
Come integrare con new ActiveXObject("Excel.Application") excel provvedi tu, non ho window e ie.codice:<html> <head> <script type="text/javascript"> function CreateExcelSheet(){ var x= document.getElementById('myTable').getElementsByTagName("input"); for (var i = 0; i < x.length; i++){ alert(i); var y = x[i].getAttribute("value") document.getElementById('ciclo').innerHTML=y; } } </script> </head> <body marginheight="0" marginwidth="0"> esporta tabella in xls </p> <table id="myTable" border="0"> <tr> <th>Name</th> <th>Age</th></tr> <tr> <td><input value="Shivani" /> </td> <td><input value="25" /></td> </tr> <tr> <td><input value="Naren" /> </td> <td><input value="28" /></td> </tr> <tr> <td><input value="Logs" /></td> <td><input value="57" /></td> </tr> <tr> <td><input value="Kas" /></td> <td><input value="54" /></td> </tr> <tr> <td><input value="Sent" /> </td> <td><input value="26" /></td> </tr> <tr> <td><input value="Bruce" /> </td> <td><input value="7" /></td> </tr> </table> <div id="ciclo"></div> </body> </html> </body> </html>
![]()
P.S. Sei consapevole che funzionerà solo ie e chiederà conferma di tale procedura? (con un avviso di sistema)