Should mailto be used in HTML5?

前端 未结 4 1582
后悔当初
后悔当初 2021-01-07 23:40

A year or so ago I decided to stop using the mailto tag because many times it is annoying to the user. It will bring up an email program that the user may not be using at th

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-08 00:08

    I recommend only using the mailto protocol when the displayed text is an email address; otherwise, the user may not understand that he is clicking on a mailto link.

    As far as spam, if you put an email address in your HTML, it's susceptible to spam. You could use JavaScript to dynamically insert email addresses into the DOM, but users without JavaScript won't be able to see the email address.

提交回复
热议问题