The hyperlinks in the li list make the selected hyperlinks active. Other hyperlinks are not active.
<Div class = "span3"> <ul class = "nav-pills nav-stacked"> <li> <a href = "#" id = "uploadFile"> upload a file (WORD) </a> </li> <a href = "#" id = "rawCorpus"> Generate a corpus (TXT) </a> </li> <a href = "#" id = "annoCorpus"> annotation corpus (XML) </a> </li> </ul> </div>
The script is as follows:
<Script type = "text/javascript"> $ (function () {$ ("li "). click (function () {// method 1 // $ ("li "). removeClass ("active"); // deletes the specified class attribute // $ (this ). addClass ("active"); // Add one or more classes to the selected element // $ (this ). toggleClass ("active"); // this function adds or deletes the selected element. var text = $ (this ). text (); // obtain the selected text // or use the second method $ (this ). addClass ("active "). siblings (). removeClass ("active") ;}) </script>