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,24 @@
var list = ['html学习', '不想学习', '想吃饭', '我没吃饱', '不写代码', '我的学习代码没写完,懒得学习'];
var Keyword = document.querySelector("input");
var ul = document.querySelector("ul");
var Newlist = []
Keyword.oninput = function() {
NewsList = [];
if (Keyword.value.length != 0) {
list.forEach(function(v) {
if (v.includes(Keyword.value)) {
v = v.replaceAll(Keyword.value, `<span>${Keyword.value}</span>`)
NewsList.push(v)
}
});
ul.innerHTML = ""
NewsList.forEach(function(v) {
ul.innerHTML += `<li>${v}</li>`
})
console.log(NewsList);
} else {
ul.innerHTML = ""
}
}