【问题标题】:How to email an HTML table through Javascript如何通过 Javascript 通过电子邮件发送 HTML 表格
【发布时间】:2018-08-18 04:01:05
【问题描述】:

我正在编写一个程序,将用户的输入发送到一个表格,然后将该表格通过电子邮件发送到某个电子邮件地址。我使用我的表的 id 在 Javascript 中制作了表。我目前正在尝试使用 jsPDF 将其发送到 PDF,但运气不佳。这可能吗?如果可以,我该怎么做?

【问题讨论】:

标签: javascript html-email jspdf


【解决方案1】:

这样就可以了:

var link = document.getElementById("mailto"),
    userInput = document.getElementById("user-input").innerHTML;
   
   
link.setAttribute("mailto", userInput);
<a href="#" id="mailto">Send to jsPDF</a>
<table id="user-input">
  Hey...
  <th>Head</th>
  <tr>
    <td>Cell 01</td>
  </tr>
  <tr>
    <td>Cell 02</td>
  </tr>
  <tr>
    <td>Cell 03</td>
  </tr>
</table>

【讨论】:

    猜你喜欢
    • 2013-01-20
    • 2014-07-01
    • 2012-02-07
    • 1970-01-01
    • 2022-10-23
    • 1970-01-01
    • 2016-03-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多