BTrem Brian Tremblay's software projects​/​websites

create-mailto.js demo

modified elements

create-mailto.js will turn elements in this section into mailto anchors

elements with only a text node

<span class="email">me@example.com</span>
<p class="email foo">me@example.com</p>
<b itemprop="email">me@example.com</b>
me@example.com
<span itemprop="email foo">me@example.com</span>
me@example.com
<em data-email="me@example.com">email me</em>
email me

elements with no content

<img data-email="me@example.com" ... >
email

elements with descendent elements, but no <a> elements

<span class="email foo"><i>me<i>@example.com</span>
<p itemprop="email foo"><i>me<i>@example.com</p>

me@example.com

<div data-email="me@example.com"><em>email</em> me</div>
email me
<blockquote data-email="me@example.com"><p>Lorem ipsum dolor sit amet....</p></blockquote>

Lorem ipsum dolor sit amet....

unmodified elements

create-mailto.js will not turn any of the elements in this section into mailto anchors

<a> elements

<a class="email" href="./">me@example.com</a>
<a class="u-email" href="./">me@example.com</a>
me@example.com
<a itemprop="email" href="./">me@example.com</a>
me@example.com

elements with descendent <a> elements

<span class="email"><a href="./">me</a>@example.com</span>
<p itemprop="email"><a href="./">me</a>@example.com</p>

me@example.com

<em data-email="me@example.com">email <a href="./">me</a></em>
email me
<blockquote data-email="me@example.com"><p>Lorem <a href="./">ipsum dolor</a> sit amet...</p></blockquote>

Lorem ipsum dolor sit amet....

elements that are descendents of <a> elements

<a href="./">foo <span class="email">me@example.com</span></a>
foo
<a href="./">bar <span itemprop="email">me@example.com</span></a>
bar me@example.com
<a href="./"><span data-email="me@example.com">email me</span></a>
baz email me
<a href="./"><blockquote data-email="me@example.com"><p>Lorem ipsum dolor sit amet...</p></blockquote></a>

Lorem ipsum dolor sit amet....

<a href="./"><img data-email="me@example.com" ... ></a>
email