【发布时间】:2014-05-22 17:48:17
【问题描述】:
我在 div 上设置了一个工具提示,如下所示; (坦率地说,我不确定我为什么要这样做,但我看到一个使用它的 sn-p 并且它以我喜欢的方式工作)
<div id="termsandconditions" class="col-xs-6" data-toggle="tooltip" title="Agree to the terms to enable the form">
<a href="#modal-terms" data-toggle="modal" class="register-terms">Terms</a>
<label class="switch switch-primary" >
<input type="checkbox" id="register-terms" name="register-terms">
<span></span>
</label>
</div>
更新 这会产生一个样式化的模式工具提示弹出窗口,我想在单击事件时更改其中的文本。 我怀疑我无法更改文本与 data-toggle 属性有关。 使用 prop 或 attr 会更改工具提示,但不会更改从 data-toggle 设置的模态工具提示弹出窗口中的标题文本。
下面其实是添加了一个tooltip,但是不要改变原来弹出的tooltip里面的文字
$("#termsandconditions").dialog("option", "title", "De-selecting terms will disable the form");
$('#termsandconditions').prop('title', 'De-selecting terms will disable the form');
【问题讨论】:
-
.prop() 作品见jsfiddle.net/satpalsingh/mFn54
-
是的,它在你的小提琴中工作,它应该,但它在我的页面上不起作用。一定有什么东西覆盖了它
-
您是否使用任何插件来呈现您的工具提示?
-
@dinotom,问题一定出在其他地方。您需要提供更多信息。截至目前,问题不是再现
标签: javascript jquery