diff options
-rw-r--r-- | doc/development/fe_guide/style/html.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/development/fe_guide/style/html.md b/doc/development/fe_guide/style/html.md index 6ccd0405e23..bdd66da760b 100644 --- a/doc/development/fe_guide/style/html.md +++ b/doc/development/fe_guide/style/html.md @@ -27,4 +27,15 @@ This prevents a security vulnerability documented by [JitBit][JitBit] <a href="url" target="_blank" rel="noopener noreferrer"></a> ``` +<a name="fake-links"></a><a name="2.2"></a> +- [2.2](#fake-links) **Avoid using fake links** Buttons should be used if a link only invokes JavaScript click event handlers. + +``` +// bad +<a class="js-do-something" href="#"></a> + +// good +<button class="js-do-something" type="button"></button> +``` + [JitBit]: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/ |