Bug 2: Tooltip Displays on Clicking

In this lesson, we will try to fix the behavior of our tooltip and making sure it doesn't display itself by merely clicking on the text.

We'll cover the following

Clicking displays the Tooltip

There’s an event JavaScript allows to be listened for – onselect. However, the docs show that it only applies to text in textarea or input elements. We’re going to have to rely on onmouseup and onmousedown then. How about if the user triggered onmousedown and onmouseup on an article div, and it wasn’t the same position. That must imply some text was selected.

Get hands-on with 1200+ tech skills courses.