我下面有HTML代码吗?
<label for="male">Hello This Will Have Some Value</label>
但是实际上我没有足够的空间来显示这么长的标签。所以我想创建标签如下。
<label for="male">Hello...</label>
然后我创建一个隐藏字段,将保留整个标签值
<input type="hidden" name="Language" value="Hello This Will Have Some Value">
现在,当用户将鼠标悬停在上面Hello...
时,我可以Hello This Will Have Some Value
使用jquery在工具提示中显示隐藏字段的值吗?
谢谢!
您可以将“ title属性”用于标签标记。
<label title="Hello This Will Have Some Value">Hello...</label>
如果您需要对外观进行更多控制,
1。尝试如下所示http://getbootstrap.com/javascript/#tooltips。但是您将需要包括引导程序。
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="left" title="Hello This Will Have Some Value">Hello...</button>
2。尝试https://jqueryui.com/tooltip/。但是您将需要包含jQueryUI。
<script type="text/javascript">
$(document).ready(function(){
$(this).tooltip();
});
</script>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句