I have the following javascript code:
window.toggle = function() {
if( document.getElementById("calendar").style.display=='none' ){
document.getElementById("calendar").style.display = '';
$(".icon-chevron-down").removeClass("icon-chevron-down").addClass("icon-chevron-up");
document.getElementById("label").innerText = "Hide calendar";
} else {
document.getElementById("calendar").style.display = 'none';
$(".icon-chevron-up").removeClass("icon-chevron-up").addClass("icon-chevron-down");
document.getElementById("label").innerText = "Show calendar";
}
}
I would like to change only a part of label, because I wouldn't like to remove bootstrap icons. Like here: http://jsfiddle.net/RkaQD/2/
Have you any hints how to cope with this disappering bootstrap icons?
Edit:
Maybe I write some example what I would like to have:
v 'show calendar'
^ 'hide calendar'
v 'show calendar'
^ 'hide calendar'
and so on...