Write a program to show how toggle button works in Bootstraps ?

 Posted by Vivek.Ramapuram on 6/9/2015 | Category: Bootstrap Interview questions | Views: 891 | Points: 40
Answer:

We have to write a little javascript and HTML for toggle function in Bootstrap .

Example :
Javascript
<script type="text/javascript"> 

$(document).ready(function ()
{
$("#toggleBtn .btn").click(function () {
$(this).button('toggle');
});
});
</script>


Adding buttons for this toggle function
HTML :
<div id="toggleBtn">

<button type="button" class="btn btn-success">True</button>
<button type="button" class="btn btn-danger">False</button>
</div>

Run the code combination in your browser.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response