zoukankan      html  css  js  c++  java
  • html 用图片代替重置按钮

    提交时,若把按钮设置成图片提交特别方便只要 <input type="image" alt="点此提交" src="images/button.png" width=40 height=50>即可,但是重置能不能是图片样子呢?

    <input type="image" src="reset.gif" onclick="javascript:document.forms['testForm_2'].reset(); returnfalse;">

    大家别再试这种javascript的方式了没有用的,无论怎么return false点击图片进行重试后,依旧是会执行提交操作,

    我用设置css样式解决了 jsp代码如下


    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>




    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        
        
        <title>My JSP 'tagnot.jsp' starting page</title>
        
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
        <style type="text/css">
    #bimg 
    {
    background:url(images/buttonreset.jpg) -60px -40px; 
    125px;
    height:30px;
    border:none;
    font-weight:bold;
    color:black;
    }
    </style>
      </head>
      
      <body>
          <form method="GET" action="">
            <input type="text" name="mae" value="wca">
            <input id="bimg" type="reset" value="重置" >
            </form>
      </body>
    </html>

    效果如图


    亲测好使,再也不会提交了,有木有,别的按钮也可以这样

  • 相关阅读:
    Sel4:显示等待
    Sel4:css定位,id,class,属性,层级
    Sel3:鼠标操作,右键,悬停,双击操作
    Sel2:Xpath定位
    Se1:css定位
    八:Appium元素UIAutomator定位方式
    七:Appium元素list定位方式
    六:Appium元素定位xpath定位方式
    五:Appium元素‘相对定位’定位方式
    四:Appium元素className定位方式
  • 原文地址:https://www.cnblogs.com/unflynaomi/p/4476858.html
Copyright © 2011-2022 走看看