I,m using tooltip in my Rails app but it not working on input field as my code is:
%input#main-search{:name => "query", :placeholder => "search all
items", :rel => "tooltip", :title => "Search All Items", :type => "text"}
:javascript
$(document).ready(function(){
$('input[title]').tooltip({placement:'bottom'});
});
I also use:
$('#main-search').tooltip({'trigger':'focus'});
Its not work for input field but for label it works fine. how can I inable tooltip for input field?
Here is valid HTML markup for tooltip:
<input data-toggle="tooltip" title="tooltip on second input!" type="text" placeholder="Focus me!" name="secondname"/>
And here is jQuery with right placement for tooltip and trigger on focus:
$('input[type=text][name=secondname]').tooltip({ /*or use any other selector, class, ID*/
placement: "right",
trigger: "focus"
});
And here is working demo: http://jsfiddle.net/N9vN8/69/