<input type="text" 鼠标移动去清空默认value onclick=javascript:this.value=''

本文介绍了一个简单的输入框示例,展示了如何使用HTML创建一个带有默认提示文本的文本输入框,并通过JavaScript实现清除默认值的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  <input name="q" type="text" value="请输入微信号或手机号"  onclick=javascript:this.value='' /> 
html代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>计算器1</title> <link rel="stylesheet" href="MyStyle.css" /> <script type="text/javascript" src="index.js"></script> </head> <body> <div class="calculator"> <input class="output" value="" id="output" disabled="disabled"/> <div> <div class="numbers"> <input type="button" value="7" onclick="calculator.numberClick(7)"/> <input type="button" value="8" onclick="calculator.numberClick(8)"/> <input type="button" value="9" onclick="calculator.numberClick(9)"/> <input type="button" value="4" onclick="calculator.numberClick(4)"/> <input type="button" value="5" onclick="calculator.numberClick(5)"/> <input type="button" value="6" onclick="calculator.numberClick(6)"/> <input type="button" value="3" onclick="calculator.numberClick(3)"/> <input type="button" value="2" onclick="calculator.numberClick(2)"/> <input type="button" value="1" onclick="calculator.numberClick(1)"/> <input type="button" value="0" onclick="calculator.numberClick(0)"/> <input type="button" value="AC" onclick="calculator.numberClick(value)"/> <input type="button" value="=" onclick="calculator.numberClick(value)"/> </div> <div class="operators"> <input type="button" value="*" onclick="calculator.numberClick(value)/> <input type="button" value="-" onclick="calculator.numberClick(value)/> <input type="button" value="+" onclick="calculator.numberClick(value)/> <input type="button" value="/" onclick="calculator.numberClick(value)/> </div> 请帮我完善js代码
03-14
``` <%@ page language="java" import="test_package.*" import="java.util.*" import="java.sql.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <link rel="stylesheet" href="../style/certificate.css"> </head> <body> <% List<test_information> list = (List<test_information>)session.getAttribute("date"); %> <div class = "tit">查看凭证</div> <div class = "Ribbon"> <table> <tr> <td> <input type = "button" value = "传统记账" class = "R_button"> <form action = ""> <input type = "submit" value = "导出"> </form> <form action = ""> <input type = "hidden" id = "select"> <input type = "submit" value = "打印"> </form> <input type = "button" value = "模板" onclick ="template.show()"> </td> </tr> </table> </div> <div class="body"> <table class="cer" > <% for(test_information news:list) { %> <!-- 将每条记录分为两列展示 --> <tr> <td class = "zero_box"> <form><input type = "hidden" value = "<%=news.getTel() %>"> <input type = "radio" > </form> </td> <td class="first_box"> <%= news.getMaterial() %> <br/> <%= news.getStart_time() %> </td> <td class="second_box"> <%= news.getWashing_method() %> <br/> <%= news.getPrice() %> </td> <td class="third_box"> <form action =""> <input name = "id" value ="<%=news.getTel() %>" type = "hidden"> <input type ="submit" class = "func_button" value = "税费" ><br> <input type ="submit" class = "func_button" value = "查看凭证" ><br> <input type ="submit" class = "func_button" value = "删除凭证" > </form> <br/> </td> </tr> <% } %> </table> </div> </body> </html>```实现选择打印功能,即在表格中选中对应的项,点击打印可以打印出来,允许多选
最新发布
03-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值