2014-12-27 40 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); 
}); 
相關問題