<table id="here" border="1">
<tr><td>London</td><td>[email protected]</td><td>aaa</td><td>aaa</td></tr>
<tr><td>Manchester</td><td>[email protected]</td><td>aaa</td><td>aaa</td></tr>
<tr><td>Liverpool</td><td>[email protected]</td><td>aaa</td><td>aaa</td></tr>
<tr><td>Ipswich</td><td>[email protected]</td><td>aaa</td><td>aaa</td></tr>
</table>
Is possible add link mailto: for second columns with email addresses with jQuery (not modify HTML)? If yes, how?
http://jsfiddle.net/zwsMD/1/
You could just replace the contents of each second td with an a element with a mailto: href: http://jsfiddle.net/zwsMD/5/.
$("#here td:nth-child(2)").each(function() {
var email = $(this).text();
// replace contents
$(this).html(
$("<a>").attr("href", "mailto:" + email).text(email)
);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With