I'm using asp.net MVC3 and i want to show a table containing information about a course In that i have a field called "Information" which show an image. I want to show the a tooltip when the mouse is taken on that image
I'm showing image lik this:
<img id="ok" src="../../Images/info.jpg" alt="tooltip"/>
I dont want to use any added plugin
can anybody help me with this?
Use title
as well as alt
in the Html tag
<img id="ok" src="../../Images/info.jpg" title="This is your tooltip message"/>
alt
attributes on img
elements are used as alternate text in case the image does not exist. Some browsers display these as tool tips when hovering over the image, but its not standard.
You could use the title
attribute to display a tool tip on hover of the image.
You should always provide an alt
attribute when using images, this is best for accessibility (screen readers read the alt
text), and will fail XHTML if you don't have the attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With