gpt4 book ai didi

javascript - 复制到 Dreamweaver 时 JSFiddle 字符计数不起作用

转载 作者:行者123 更新时间:2023-11-28 19:15:26 25 4
gpt4 key购买 nike

我似乎有点生气,我从 JSFiddle 复制了一个脚本(在这里找到 http://jsfiddle.net/xL3uugux/1/ ),下面是我的 Dreamweaver 代码

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
html {
margin:11px
}
</style>
<script type="text/javascript">
$(document).ready(function () {
var text_max = 99;
$('#textarea_feedback').html(text_max + ' characters remaining');

$('#textarea').keyup(function () {
var text_length = $('#textarea').val().length;
var text_remaining = text_max - text_length;

$('#textarea_feedback').html(text_remaining + ' characters remaining');
});
});
</script>
</head>

<body>
<textarea id="textarea" rows="8" cols="30" maxlength="99"></textarea>
<div id="textarea_feedback"></div>
</body>
</html>

但是这不起作用!我猜这对其他人来说可能非常明显,但我找不到问题!

请帮忙!

最佳答案

您需要加载 jQuery 库,例如:

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

在jsFiddle窗口的左上角,您可以看到使用的是jQuery版本1.7.1。

关于javascript - 复制到 Dreamweaver 时 JSFiddle 字符计数不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29968991/

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