Bootstrap~“aria-expanded”不接受元素<a>

时间:2015-05-13 03:05:46

标签: html5 twitter-bootstrap netbeans-8

I lack of idea why the sample copy from Bootstrap are not able to workout and keep throwing the error message on below:

Attribute "aria-expanded" not allowed on element "a" at this point.

<ul class="nav navbar-nav">
                        <li><a href="#">Home </a></li>
                        <li><a href="#">Log-In</a></li>
                        <li class="dropdown">
                            <a href="#" aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown" role="button" >
                                Management <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu" role="presentation">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li> 
                                <li class="divider"></li>
                                <li><a href="#">Separated link</a></li>
                                <li class="divider"></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
</ul>

Anyone have face the same problem before? Please help!!!

1 个答案:

答案 0 :(得分:6)

使用以下

<li class="dropdown active">

<li class="dropdown active open">

而不是直接设置

aria-expanded="false"

aria-expanded="true"
分别