开发者

how to make html anchor accessible in asp.net mvc web application?

If i use a anchor tag in my asp.net mvc 2 web app how can i make sure the user can 'tab' to it in case he is just using his keyboard?

I use something like this but it is not accessible?

 <a id="someanchor">Upload statement</a>

   $(开发者_如何学编程"#someanchor").click(function () {
            //some js
        });

how to create an anchor tag that is accesible?


You need an href - without one, the anchor is considered to be a non-interactive placeholder.

<a id="someanchor" href="javascript:void(0)">Upload statement</a>

In this case, the href is present, so the A ends up being a tabbable link and can be activated via keyboard, but the target URL - javascript:void(0) - is basically a no-op, so no actual navigation occurs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜