0

I have the following HTML element ("spokenNames") I want to display a Tooltip on using a Tampermonkey script and, as I think is required, jQuery.

I have added // @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js to the script.

1) Is my problem a syntax issue? 2) Do I need other/different api?

I have only basic JS knowledge and just get started with jQuery/HTML.

I have reviewed https://jquerytools.github.io/demos/tooltip/any-html.html, but still am not sure adding a tooltip is possible when I don't own original HTML that gets loaded.

All solutions I found seem to suggest I must make changes to the HTML itself (e.g. http://qtip2.com/api)

<tr>
    <td class="row" width="30%">Inames</td>
    <td>
    <div id="spokenNames"                                            
    style="white-space: normal; word-wrap: break-word;">                                            
    &#149; bierflasche                                          
    <br />  
    </div>
    </td>
</tr>

I tried this $("#spokenNames").tooltip({ effect: 'slide'}); but no ToolTip shows.

Reza Ramezanpour
  • 585
  • 8
  • 28
MKKirk
  • 49
  • 8

1 Answers1

1

This solved it for me!

Full code that worked:

$( document ).ready(function() {
    $("#spokenNames").prop('title', 'What an awesome tooltip');
});
MKKirk
  • 49
  • 8