0

How can I do this(or something alike this) tooltip in only javascript without linking any template styles (I don't want to implement It to all the tooltips on the whole page). I'm designing the webpage on SharePoint which deletes all the ... https://www.w3schools.com/css/tryit.asp?filename=trycss_tooltip_top

Sara980710
  • 11
  • 1

1 Answers1

0

You can always add inline styles via JS.

var a = document.getElementsByClassName("class-name");
a.forEach(function(e) {
  e.style.property = "value";
});

For adding :hover effects however, I think you need to append a stylesheet. Example.

Your other option is to use mouseover effects, but that is ridiculous when :hover exists.

Community
  • 1
  • 1
Chris Thorsvik
  • 450
  • 7
  • 15
  • Well I am kind of new to this, but then do you write?:

    Hover me

    And then when you hover "value" will show?

    – Sara980710 Apr 17 '17 at 14:33
  • It should. Though, you can't easily add hover effects that way. Look at the example link. That is probably easier for your situation. – Chris Thorsvik Apr 17 '17 at 14:41