2

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

Community
  • 1
  • 1
Henry
  • 1,042
  • 2
  • 17
  • 47
  • My initial thought was "But that *is* javascript." Then I realised that you seem to be asking how to do it without using a library? – nnnnnn Mar 10 '16 at 08:58
  • Yea, so currently the apporach I am using uses jquery library. – Henry Mar 10 '16 at 09:02

1 Answers1

3

Check this it work same like you have done in jquery

document.getElementById("test").title = document.getElementById("test").title + 'text to append';
Santosh Ram Kunjir
  • 1,074
  • 1
  • 12
  • 23