I am very much new to html, css, javascript, jQuery. I want to show tooltip depending the button. Button while showing Play icon it should show 'Run' as tooltip and when Stop icon is showing it should show 'Stop' as tool tip. This code is part of HTML template
<div class='btn-group'>
<button class='btn btn-inverse playstop' rel='tooltip'
data-original-title='Run><i class='icon-play'></i></button>
</div>
In the script for one condition i have
$(".icon-stop", $this.element).attr("data-original-title", "Run");
$(".icon-stop", $this.element).removeClass("icon-stop").addClass("icon-play");
and for other condition i have
$(".icon-play", $this.element).attr("title", "Stop");
$(".icon-play", $this.element).removeClass("icon-play").addClass("icon-stop");