2014-12-27 81 views
-4

嗨需要动态构建主题。即我有一些我想添加到主题中的数据。mailto HTML动态构建主题的电子邮件链接

例如,如果我只是建立HTML我可以写:

<span style="color: #434343; font-family: 'Segoe UI REGULAR'; font-size: 12pt;"> 
    <text id="supportDescription">Id is '[context.eventId]' .</text> 
</span> 

当打开HTML我会看到Id is 345345一种说法) 不是增加一个id到HTML的,我想添加mailto链接包括id

<a href="mailto:[email protected]?subject=The%20 reply for evetId '[context.eventId]'">Send mail </a> 

将在这里变电站工作也。主题将是The reply for evetId 345

+0

你为什么不试试呢? – 2014-12-27 14:20:30

回答

0

您可以使用jQuery事件处理程序将输入中输入的任何文本放入链接中,以便更改输入值。 DEMO

$('input#eventid'). on('change', function() { 
    var link = "mailto:[email protected]?subject=The%20reply%20for%20evetId%20" + $(this). val(); 
    $('a#mailto').attr('href', link); 
}); 
相关问题