html - Adding tooltips to jQuery dynamically created elements -


i found helpful jsfiddle on adding tooltips jquery.

how same results dynamically created elements?

without plugins, if thtas possible.

http://jsfiddle.net/uqty2/29/

depending on options user ticks, div display 1 of 3 coloured circles show importance of task. can add tooltip circles in manner such this?

  jquery(function() {       jquery( '.veryimportant' ).tooltip();   }); 

you add tooltip how would, make sure calling .tooltip() after element has been added page. based on code, seems you're trying add immediately, , if element doesn't exist, never it.

simple sample:

<div id='test'>im div</div>  $("#test").append("<span id='spantest'>hey</span>"); $("#spantest").tooltip(); //works fine, since element exists @ time of call 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -