</script> 标记的 src 路径中上一层-6ren"> </script> 标记的 src 路径中上一层-我的文件夹结构如下。 我在 html_files 文件夹中有 index.html 文件。 我在我的 index.html 文件中使用如下脚本标记。 但是 jQuery 函数 hide() 不起作用。-6ren">
gpt4 book ai didi

jquery - 在 HTML 中的 <script src =""></script> 标记的 src 路径中上一层

转载 作者:行者123 更新时间:2023-12-01 07:39:59 25 4
gpt4 key购买 nike

我的文件夹结构如下。

enter image description here

我在 html_files 文件夹中有 index.html 文件。

我在我的 index.html 文件中使用如下脚本标记。

enter image description here

但是 jQuery 函数 hide() 不起作用。我在这里做错了什么吗..?请帮助我。提前致谢。

最佳答案

您需要确保您的 hide() 调用已绑定(bind)到事件。 $(document).ready() 的简写应该可以帮助您:

$(function() {
$('h1').hide();
});

引用http://learn.jquery.com/using-jquery-core/document-ready/了解更多信息。

关于jquery - 在 HTML 中的 &lt;script src ="">&lt;/script&gt; 标记的 src 路径中上一层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51820839/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com