admin管理员组

文章数量:1279177

Bootstrap Button Link Not Working see code below:

<ul>
  <li>
      <a href="home.aspx?Id=146">
            <button class="btn btn-primary btn">Button Link</button>             
      </a>
 </li>
</ul>

I use firebug for development, is there an easy place to see what javascript events are attached and to which objects such as this button class? find it hard to debug as don't know what code is being called and on what events for bootstrap and other external js files

Bootstrap Button Link Not Working see code below:

<ul>
  <li>
      <a href="home.aspx?Id=146">
            <button class="btn btn-primary btn">Button Link</button>             
      </a>
 </li>
</ul>

I use firebug for development, is there an easy place to see what javascript events are attached and to which objects such as this button class? find it hard to debug as don't know what code is being called and on what events for bootstrap and other external js files

Share Improve this question edited Jan 24, 2014 at 12:35 Carol Skelly 363k91 gold badges735 silver badges646 bronze badges asked Jan 24, 2014 at 12:27 user3231982user3231982 451 gold badge2 silver badges5 bronze badges 1
  • 4 why do you need a button inside an anchor tag? simply add the "btn btn-primary" classes to the anchor tag – Abhidev Commented Jan 24, 2014 at 12:31
Add a ment  | 

2 Answers 2

Reset to default 7

Or, you can just use a link which looks like a button..

<a href="home.aspx?Id=146" class="btn btn-primary">Button Link</a>

Remove a tag and add window.location.href to button onclick

<button class="btn btn-primary btn" 
        onclick="window.location.href='home.aspx?Id=146'; return false;">
        Button Link
</button>

本文标签: javascriptBootstrap Button Link Not WorkingStack Overflow