图示:
本次小实例中需要用到正则表达式;匹配替换,用到replace
创建html文件demo.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>敏感词过滤</title>
</head>
<body>
<h2>敏感词过滤</h2>
<p>
<!-- 用户输入框 -->
<textarea name="" id="area" cols="30" rows="10"></textarea>
</p>
<p>
<!-- 点击提交 -->