Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


tooltips inside searchbox

tooltips inside searchbox

Using jquery i'm creating searchboxes that pull data from a MYSQL DB. How can I add tooltips into this:


var impact_header_text = $("<div>Impact (EX: Panic)</div>");  <-- display header

        var impact_search_box = $('<input>')                 <--actual searchbox
            .attr('id', 'impact')
            .change(function (event) {
        var impact_header = $("<th>")

--- You must not fight too often with one enemy, or you will teach him all your tricks of war.

RE: tooltips inside searchbox

Set the title attribute with the text of the tool tip.

RE: tooltips inside searchbox

if I have a simple function like this:


$('[tooltip]').each(function() // Select all elements with the "tooltip" attribute
   $(this).qtip({ content: $(this).attr('tooltip') }); // Retrieve the tooltip attribute value from the current element

Can I just add an .attr into the search box? Such as:


var bug_rel_search_box = $('<input>')
            .attr('id', 'bug_rel')
            .attr('title', tooltip="test")
            .change(function (event) {

--- You must not fight too often with one enemy, or you will teach him all your tricks of war.

RE: tooltips inside searchbox

you are over complicating it.

in html the title attribute pops up on hover


<a href="somepage.php" title="If you hover here you will see this pop up">Hover Here</a> 

so if you want to add tooltips dynamically to a dom element in jQuery you just do this


$('#myDomElementID').attr('title','If you hover here you will see this pop up'); 

you can you fancy classes to pop up highly styled floating non-modal dialog boxes, but why unless there is a business required to do so, why bother?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close