How to change tooltip of a div tag through Javascript?

125 Views Asked by At

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

1

There are 1 best solutions below

0
Santosh Ram Kunjir On BEST ANSWER

Check this it work same like you have done in jquery

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