Sparkler Sparkler - 2 months ago 9
HTML Question

Is it effective to obfuscate email address by splitting inner html into multiple span elements?

String replacement via jQuery and bidi rtl via CSS were suggested previously. The problem with

direction: rtl;
is that if someone copy-pastes the email address, it comes out in reverse:

<a href="mailto:address@to.be.replaced.by.jQuery" id="lnkMail">moc.elpmaxe@em</a>


Instead of using using rtl, would it be safe to split the inner html of the
<a>
element into multiple
<span>
elements? For example:

<a href="mailto:address@to.be.replaced.by.jQuery" id="lnkMail">
<span>me@</span>
<span>example</span>
<span>.com</span>
</a>

Answer

No, not really. Node.textContent removes all HTML tags, which is a likely thing for a scraping algorithm to do.

Comments