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"></span>
<p class="email foo"></p>
<b itemprop="email"></b>
<span itemprop="email foo"></span>
<em data-email="">email me</em>
email me

elements with no content

<img data-email="" ... >

elements with descendent elements, but no <a> elements

<span class="email foo"><i>me<i></span>
<p itemprop="email foo"><i>me<i></p>

<div data-email=""><em>email</em> me</div>
email me
<blockquote data-email=""><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="./"></a>
<a class="u-email" href="./"></a>
<a itemprop="email" href="./"></a>

elements with descendent <a> elements

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

<em data-email="">email <a href="./">me</a></em>
email me
<blockquote data-email=""><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"></span></a>
<a href="./">bar <span itemprop="email"></span></a>
<a href="./"><span data-email="">email me</span></a>
baz email me
<a href="./"><blockquote data-email=""><p>Lorem ipsum dolor sit amet...</p></blockquote></a>

Lorem ipsum dolor sit amet....

<a href="./"><img data-email="" ... ></a>