JQUERY Change Title not working with tooltip

夙愿已清 提交于 2019-12-06 01:32:18

You can't use

$(moreButton).attr("title", "Show Post");

Because the tooltip get initialized by jQuery UI. Instead use this:

$(moreButton).tooltip( "option", "content", "Show Post - test" );

RTM: http://api.jqueryui.com/tooltip/#option-content

I was using Jquery with bootstrap and neither of these worked. I had to do this:

$("#myelement").attr("data-original-title", "New title/message" );

This worked from inside a dynamically loaded modal using ajax - and the original page elements were changed so it seems solid.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!