Henry
Henry

Reputation: 1042

How to change tooltip of a div tag through Javascript?

currently I am using Jquery to append text on to tooltip like this;

$('#test').attr('title', $('#test').attr('title') + ' text to append');

What I would like to know is, how can I achieve this via javascript?

Any help is welcomed, I did some research but had no luck.

Easy Tooltip content change via Javascript

Changing the tooltip of button dynamically in html

Upvotes: 2

Views: 125

Answers (1)

Santosh Ram Kunjir
Santosh Ram Kunjir

Reputation: 1082

Check this it work same like you have done in jquery

document.getElementById("test").title = document.getElementById("test").title + 'text to append';

Upvotes: 3

Related Questions