first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>留言</title>
<style>
.main {
width: 400px;
height: 350px;
margin: 30px auto;
position: relative;
}
textarea {
width: 100%;
height: 100%;
resize: none;
}
.main span {
position: absolute;
right: 10px;
bottom: 10px;
}
</style>
</head>
<body>
<div class="main">
<textarea name="" id="" cols="30" rows="10"></textarea>
<span>300/300</span>
</div>
<script>
var totalNums = 300;
$("textarea").oninput = function () {
var syLength = totalNums - $("textarea").value.length;
if (syLength < 0) {
$("textarea").value = $("textarea").value.substring(0,300)
$("span").innerText = `300/0`
} else {
$("span").innerText = `300/${syLength}`
}
}
function $(className) {
return document.querySelector(className)
}
</script>
</body>
</html>