2

Hello I am making a button and for some reason when I click on it I does not open Projects.php, and I can not find out why it does not work here is my code:

<h1>Projects</h1>

<p> Some text</p>

<button type="button" class="btn btn-default" href="Projects.php">View details »</button>

I have the following libraries linked:

<link href="css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>

I download the bootstrap file from the bootstrap site and put the folders in my directory. My file is saved as index.php (because php code is my file)

Any help is appreciated!

NateW
  • 2,101
  • 3
  • 28
  • 37
John Smith
  • 101
  • 1
  • 1
  • 9

2 Answers2

6

Buttons don't act as links unless they're in a form (more on that). I don't think you want the behavior of a button anyway. Do this:

<a class="btn btn-default" href="Projects.php">View details »</a>
Community
  • 1
  • 1
isherwood
  • 58,414
  • 16
  • 114
  • 157
0

If you are using bootstrap 3.1.1 then in your script at the bottom, you should import jquery v1.11.0 instead of v1.11.2

Aramil Rey
  • 3,387
  • 1
  • 19
  • 30