【发布时间】:2021-06-05 23:33:24
【问题描述】:
我想做一个JS函数,可以从元素中截屏然后下载。
<body>
<h1>Sample text</h1>
<h2>Sample text</h2>
<table width="1080px" height="1920px" border="1" style="border-collapse:collapse">
<tbody><tr>
<td colspan="2">
<img src="https://inspectiondoc.com/wp-content/uploads/2014/08/sample-icon.png" width="600px">
</td>
<td>
Sample text
</td>
</tr>
<tr style="background:#b6ff00">
<td>
Sample text
</td>
<td>
Sample text
</td>
<td>
Sample text
</td>
</tr>
</tbody></table>
<h1>
sample text
</h1>
<h2>Sample text</h2>
<br><br>
<input type="button" value="Capture" onclick="capture()">
</body>
点击捕获按钮后,我希望这个 td colspan="2" 元素被截屏并以 jpg 或 png 格式下载。
【问题讨论】:
-
不完全,但谢谢
标签: javascript