I only got into Javascript, HTML and CSS a few days ago, so I'm quite new to it.... Anyway, I'm trying to make a vertical menu with Twitter's Bootstrap. I've managed to make the menu just fine, but I want to make it so when you click on a button on the menu, it will make the button have the "active" class, I tried my best to do it, it works, but only if you select the menu options in order, here is my code and if somebody can help me fix this up, that'd be great!
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">
<link rel="stylesheet" href="stylehelp.css">
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Indie+Flower' rel='stylesheet' type='text/css'>
</head>
<body>
<script>
function navigationSwitch1(){
document.getElementById("oogabooga").innerHTML = "It works.";
document.getElementById("gotclass").className = "placeholder"
document.getElementById("gotclass").id = "noclass2"
document.getElementById("noclass").className = "active gotclass";
document.getElementById("noclass").id = "gotclass";
}
function navigationSwitch2(){
document.getElementById("oogabooga").innerHTML = "It works.";
document.getElementById("gotclass").className = "placeholder"
document.getElementById("gotclass").id = "noclass"
document.getElementById("noclass1").className = "active gotclass";
document.getElementById("noclass1").id = "gotclass";
}
function navigationSwitch3(){
document.getElementById("oogabooga").innerHTML = "It works.";
document.getElementById("gotclass").className = "placeholder"
document.getElementById("gotclass").id = "noclass1"
document.getElementById("noclass2").className = "active gotclass";
document.getElementById("noclass2").id = "gotclass";
}
</script>
<title>Help</title>
<div class="nav">
<div class="container">
<ul class="pull-left nav nav-pills">
<li><a href="index.html">Home</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="cars.html">Cars</a></li>
</ul>
<ul class="pull-right nav nav-pills">
<li><a href="customerservice.html">Customer Care</a></li>
<li class="active"><a href="help.html">Help</a></li>
</ul>
</div>
</div>
<div class="container1 col-md-10">
<ul class="nav nav-pills nav-stacked col-md-10">
<li class="active" id="gotclass" onclick="navigationSwitch1()"><a href="#">Test</a></li>
<li class="placeholder" id="noclass1" onclick="navigationSwitch2()"><a href="#">Test1</a></li>
<li class="placeholder" id="noclass2" onclick="navigationSwitch3()"><a href="#">Test2</a></li>
</ul>
</div>
<div class="text">
<div class="container">
<p id="oogabooga">This is some simple text</p>
</div>
</div>
</body>
</html>