role="button" for <a href

Hi I would like to know how bootstrap can add role="button" to there a href link.

<a href="" role="button">

I can not see the role button anywhere in the css

I am trying to make my own version.


What exactly do you want the link/button to do?

If you are just looking at styling the link to look like a bootstrap button you can just add the button classes to it:

<a href="#" class="btn btn-primary">A Link</a>

if you want it to function like a button (ie submit a form or something) then you will need javascript or jQuery would be better in order to do that:

    <a href="#" id="myButton">A Link</a>
    <script>
    $(document).ready(function(){
        $("#myButton").click(function(){
            $("#myFormID").submit();
        }); 
    });
    </script>

Then just combine the two and the anchor link will appear and act like a button.

链接地址: http://www.djcxy.com/p/36620.html

上一篇: Twitter Bootstrap ARIA

下一篇: 角色=“按钮”用于<a href