I have an element that when hovered over, it displays the price of the item (in a game). I\'m using the jQuery UI tooltip to power the display of the information about each
Why not do it this way?
// Every time a key is pressed (for the sake of example)
$(function(){
// Initialize tooltip
$('.input-change').tooltip();
// Every time a key is pressed (again, for the sake of example)
$(".input-change").keyup(function(){
// Get the actual value of the input that has changed (again, for the sake of example)
var inputValue = $(this).val();
// Get the id of the input that has changed
var idInputChanged = "#" + $(this).attr('aria-describedby');
// Go directly to the inside the tooltip and change the text
$(idInputChanged + ' div').html('Text changed in real time without closing tooltip!:
' + inputValue);
});
})
JSFiddle Example:
http://jsfiddle.net/4MT5R/