【问题标题】:jquery not working in css [closed]jquery在css中不起作用[关闭]
【发布时间】:2016-04-02 10:30:54
【问题描述】:

我无法让我的代码正常工作,我不知道为什么。 这是 jsfiddle 的链接。

Js fiddle

$(document).ready(funciton() {
  $("button").click(function() {
    $("h1").css("color", "red");
  });
});
<h1>
Testing123
</h1>
<button>
  Make the h1 red
</button>

【问题讨论】:

标签: jquery css


【解决方案1】:

您必须包含 jquery 库链接才能使用 jquery 命名法。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

另外你在第一行有错字

$(document).ready(funciton() {...

应该是

$(document).ready(function() {...

【讨论】:

    猜你喜欢
    • 2013-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-09
    • 2014-01-24
    • 1970-01-01
    • 2012-01-17
    • 1970-01-01
    相关资源
    最近更新 更多