0

In my Angular program, I want to display a string of text that says what the button does whenever you hover over the button.

How do I do this?

Here's a picture of what I'm talking about.

My mouse is hovering over the google button.

Here's my html code for one of my buttons if it helps:

          <button [disabled]="!isDisabled" name="enable" class="btn btn-default btn-margin" (click)="toggleDisabled()"><i class="fa fa-pencil" aria-hidden="true"></i></button>
rcarcia02
  • 927
  • 4
  • 15
  • 46
  • did you try the title attribute? example here https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_global_title – Karan Garg Jul 17 '17 at 17:07
  • @KaranGarg I was unaware of that, thanks - works perfectly! if you want to put that as an answer, I'll accept it – rcarcia02 Jul 17 '17 at 17:10

3 Answers3

2

You can use title

          <button [disabled]="!isDisabled" name="enable" class="btn btn-default btn-margin" (click)="toggleDisabled()" title="Something"><i class="fa fa-pencil" aria-hidden="true"></i></button>
Bharath M Shetty
  • 30,075
  • 6
  • 57
  • 108
1

did you try the title attribute?

title="hello world"

example here

http://w3schools.com/tags/tryit.asp?filename=tryhtml5_global_title

Karan Garg
  • 1,083
  • 10
  • 9
0

add

title="my tooltip text"

or

[title]="aPropertyWithTooltipContent"

see also tooltips for Button

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567