源码

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">

    <title>示例</title>

</head>

<body>

    <input type="text" value="123123" id="test1">

    <input type="button" value="清空" onclick="document.getElementById('test1').value=''" />

</body> 

</html>

示例

示例

2022-11-19T16:27:08.png

转载
html怎么清空文本框内容 - 问答 - 亿速云
https://www.yisu.com/ask/5353.html