How to change Chevron Up and Down using Bootstrap

Posted by Manideepgoud under Bootstrap category on | Points: 40 | Views : 1191
Here we are going to see how to change the chevron icon up and down using bootstrap, we have used jquery and javascript to change icons.
<!DOCTYPE html>
<title>Angularjs Application</title>
<script src=""></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
var change = true;
$(document).ready(function () {
$('[data-toggle=offcanvas]').click(function () {

function find() {
$("#caret1").toggleClass("glyphicon-chevron-up", change);
$("#caret1").toggleClass("glyphicon-chevron-down", !change);
change = !change
<p style="color:blue;">Chevron Up and Chevron Down</p>
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<li onclick="find()">
<a href="#" data-toggle="collapse" data-target="#sub1">Click Here<small><span style="float:right" id="caret1" class="glyphicon glyphicon-chevron-down"></span></small></a>
<ul class="nav collapse" id="sub1">
<a href="#">Hai</a>


Comments or Responses

Login to post response