关于输入焦点的提示

Qtip on input focus

本文关键字:焦点 提示 输入 于输入      更新时间:2023-09-26

我想在输入获得焦点时显示Qtip。下面是我的代码:

<script>
    function inputQtip(){
    alert("Test");
    $('#aerobot[title]').qtip({
        position: {
            my: 'right center',
            at: 'left center',
            target: $('.aerobot'),
        },
        show: {
            when: {
                target: $('#aerobot'),
                event: 'focus',
            },
        }
    });
}
inputQtip();
</script>

它不工作。警报弹出窗口。所以函数正在执行。这个提示有什么问题?(

这段代码没有任何问题。你只是忘了把它包装在文档中。准备功能。

$(document).ready(function() {
    inputQtip();
});