我尝试将动态列表导出到excel / notepad / notepad ++ / word。 我看到了将表导出到excel的方法,但这并没有解决我的问题。 我的无序列表包含多个列表(可更改),我要导出的值是类型text(value_to_export)的输入值。 如何导出所有这些列表值? 谢谢?
<ul>
<li id="0" class="list">
<input type="checkbox" class="" id="" value="">
<input type="text" id="" title="" class="" value="value_to_export">
</li>
</ul>
答案 0 :(得分:0)
您可以使用HTML表格代替li。
table2excel是一个简单但有用的jQuery插件,允许将Html表数据导出到Excel文件。
< script src = "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" > < /script>
<script src="src/jquery.table2excel.js "></script>
&#13;
<button>Export</button>
&#13;
$("button").click(function(){
$("#table2excel").table2excel({
// exclude CSS class
exclude: ".noExl",
name: "Excel Document Name"
});
});
&#13;
<tr class="noExl">
<th>#</th>
<th>Column heading</th>
<th>Column heading</th>
<th>Column heading</th>
</tr>
&#13;