如何使用 jquery ui 自动完成使匹配的文本加粗? [英] How to make matched text bold with jquery ui autocomplete?
问题描述
我想知道如何在使用 jquery ui 自动完成时使自动完成建议的匹配部分加粗?
I am wondering how to make the matched part of the autocomplete suggestions bold when using jquery ui autocomplete?
因此,例如,如果您输入ja"并且建议是 javascript 和 java(如 jquery ui 演示页面上的示例),那么我想在这两个建议中都将ja"设为粗体.
So for example if you type in "ja" and the suggestions are javascript and java (like in the example on the jquery ui demo page) then I would like to make "ja" bold in both suggestions.
有人知道怎么做吗?
非常感谢您的帮助...
Thanks a lot for the help...
推荐答案
我不知道为什么自动完成与它包含的其他功能(例如可放置、可排序、可拖动等)相比如此简单.
I'm not sure why the autocomplete is so bare-bone compared to the other functionalities it contains (e.g. droppable, sortable, draggable etc.).
它确实应该为您提供一个可样式化的选项,例如用 <span class="ui-autocomplete-term">term</span>
或类似的东西包装它.
It should really offer you with a stylable option, e.g. wrapping it with <span class="ui-autocomplete-term">term</span>
or something similar.
你可以像这个
它应该是不言自明的;如果没有,请大声喊叫.
It should be pretty self-explanatory; if not, gimme a shout.
这篇关于如何使用 jquery ui 自动完成使匹配的文本加粗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!