<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
<style type="text/css" media="screen">
span{
background: red;
}
</style>
</head>
<body>
<input type="text" id="input">
<button id="btn">搜索</button>
<hr>
<p id="content">
You should probably watch at 1.5x and skip parts you are familiar with. I go through pretty ploddingly with only a couple edits at the beginning. The rest is stream of consciousness. Here is the code
</p>
</body>
</html>
<script type="text/javascript">
var btn=document.getElementById('btn');
var content=document.getElementById('content');
btn.=function(){
var input=document.getElementById('input');
var val=input.value;
if(input.value<=0){
return;
}
//Awal html ning Text Kimmit Ni elwal Dim
var text=content.innerText;
//Html Ning Html Mazmun Ni Kuruk Diwattim
content.innerHTML='';
//Html Ning Mazmu Niga = Elwal Gan Text Kimmat Ni , span Bar Kimmat Ka Almax Turwattim
content.innerHTML=text.replace(val,"<span class='key'>"+val+"</span>")
}
</script>
共同学习,写下你的评论
评论加载中...
作者其他优质文章