Is there a way to achieve an effect similar to Position Relative in CSS using jQuery?
I have developed a tooltip that I want to attach to various objects like textboxes, checkboxes, and other text elements.
My code looks something like this:
<input id="adsfjlk" type="textbox" />
<div class="TooltipBalloon"> SOME TEXT</div>
However, CSS relative positioning is dependent on the element's parent. Since I cannot place a div inside an input element, I have used jQuery to position the tooltip next to the textbox.
The issue arises when changes occur on the page. For instance, if there is an expanding textarea above the textbox, it causes the textbox to shift down, resulting in misalignment of the tooltip.
Given the unpredictability of these changes, applying an OnChange event to the elastic element is not feasible. I need a more effective method to maintain the relative positioning of these elements.