html的text控件如何用jquery设置输入的内容变为*
发布网友
发布时间:2022-04-21 05:46
我来回答
共1个回答
热心网友
时间:2022-04-21 07:15
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>menu</title>
<style type="text/css">
</style>
<script type="text/javascript">
onload = function ()
{
txt.onkeyup = function ()
{
this.value = this.value.replace (/./g, '*');
}
}
</script>
</head>
<body>
<input type="text" id="txt" />
<input type="password" />
</body>
</html>