New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Adding the tip info

From: Create a Tooltip with jQuery and Dreamweaver

Video: Adding the tip info

Now in order to have content for our tooltip we're going to need to add some content into the HTML so that we can actually pull this out of jQuery later. So what we're going to do is let's scroll up in our HTML file. Let's find the hyperlink that's not inside of the aside, but still inside of the article. It's the one down here that says text-based tooltip. We have an anchor link outside of here with an href. Inside of this anchor tag we want to add some additional attributes. Let's first start by typing class and the class we want to set for this going to be tooltip.

Adding the tip info

Now in order to have content for our tooltip we're going to need to add some content into the HTML so that we can actually pull this out of jQuery later. So what we're going to do is let's scroll up in our HTML file. Let's find the hyperlink that's not inside of the aside, but still inside of the article. It's the one down here that says text-based tooltip. We have an anchor link outside of here with an href. Inside of this anchor tag we want to add some additional attributes. Let's first start by typing class and the class we want to set for this going to be tooltip.

Next property, we're going to set in HTML5 data property. So we're going to data dash and then we're going to make up in attribute name here, tip dash type equals, two quotes, and then let's say "text" inside of that. Then one more attribute. Data dash, tip dash, source equals two quotes, and inside of here we're going to the actual text that's going to show up as the tooltip "This is the tip text." So now we have these three additional attributes inside of here.

If you remember in the introduction video we had two different types of tooltips text-based ones and HTML formatted ones. So what we're doing here is under data-type- type we're going to set this one to "text". And then we're going to pick up a data- tip-source and used this text to inject into the tooltip container. So now that we have some tool-tip- data in our HTML file, next we can start working on our JavaScript.

Show transcript

This video is part of

Image for Create a Tooltip with jQuery and Dreamweaver
Create a Tooltip with jQuery and Dreamweaver

18 video lessons · 4154 viewers

Chris Converse
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.