
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
Getting Tooltips for mobile browsers in HTML
When you will click on an element with a title attribute, a child element with title text is appended. Let us see an example −
For HTML −
<p> The <span class="demo" title="this is underscore">underlined</span> character. </p>
jQuery −
$("span[title]").click(function () { var $title = $(this).find(".title"); if (!$title.length) { $(this).append('<span class="title">' + $(this).attr("title") + '</span>'); } else { $title.remove(); } });
The following is the CSS −
.demo { border-bottom: 2px dotted; position: relative; } .demo .title { position: absolute; top: 15px; background: gray; padding: 5px; left: 0; white-space: nowrap; }
- Related Articles
- Disabling Pull-to-Refresh Feature on Mobile Browsers using CSS
- Creating Browsers Window using HTML and CSS
- Create tooltips with CSS
- How does WhatsApp/Mobile Marketing help in Getting Leads: A Guide
- How do I display tooltips in Tkinter?
- How to create tooltips with CSS?
- Getting Safari to recognize HTML 5
- Optimizing SVG-based sprite-sheets for CSS3 HW GPU acceleration in the mobile browser with HTML
- How to fix Array indexOf() in JavaScript for Internet Explorer browsers?
- How to give a warning for Non-JavaScript Browsers?
- How to position tooltips correctly with CSS
- Running Cypress in supported Browsers
- Same origin policy on mobile apps with HTML
- Getting Ready for Analytics
- Getting HTML form values and display on console in JavaScript?

Advertisements