<input> type 属性

 

 

 

  1 

 

语法 :<input type="value">

实例:

  1.button:定义可点击的按钮;定义可点击的按钮,在用户单击按钮时启动一段 JavaScript:

  <input type="button" value="点我" οnclick="msg()">

  

  2.checkbox:定义复选框;复选框允许用户在一定数量的选择中选取一个或多个选项:

  <input type="checkbox" name="vehicle[]" value="Bike"> 吃<br>
  <input type="checkbox" name="vehicle[]" value="Car"> 睡<br>

  <input type="checkbox" name="vehicle[]" value="Boat"> 玩<br>

    

  3.color:定义拾色器。

  选择你喜欢的颜色: <input type="color" name="favcolor"><br>

   

 

  18  4.date:定义 date 控件(包括年、月、日,不包括时间)。

  生日: <input type="date" name="bday">

  5.datetime:定义 date 和 time 控件(带有时区):

  生日(日期和时间):<input type="datetime" name="bdaytime">

   

  6.datetime-local:定义 date 和 time 控件(不带时区):

   生日 (日期和时间):<input type="datetime-local" name="bdaytime">
  
 
  7.email:定义用于e-mail地址的字段
  E-mail: <input type="email" name="usremail">
  

  8.file:定义文件选择字段和“浏览”按钮,供文件上传:

  选择一个文件: <input type="file" name="img">

  

 

  9.hidden:定义隐藏字段,隐藏字段对于用户是不可见的。隐藏字段常常存储默认值,或者由 JavaScript 改变它们的值:

  <input type="hidden" name="country" value="Norway">

  10. image:定义图像作为提交按钮:

  <input type="image" src="img_submit.gif" alt="Submit">      

    

  11.month:定义 month 和 year 控件(不带时区)。

  生日 ( 月和年 ): <input type="month" name="bdaymonth">

  

  12.number:定义用于输入数字的字段(您可以设置可接受数字的限制):

  数量 ( 1 到 5 之间): <input type="number" name="quantity" min="1" max="5">
 
  

 

  13.password:定义密码字段(密码字段中的字符会被遮蔽):

  <input type="password" name="pwd">

   

  14.radio:允许用户在一定数量的选择中选取一个选项:

  <input type="radio" name="gender" value="male"> Male<br>
  <input type="radio" name="gender" value="女"> 女

  

  15.range:定义用于精确值不重要的输入数字的控件(比如 slider 控件)。您也可以设置可接受数字的限制:

  <input type="range" name="points" min="1" max="10">
     
  16.reset:定义重置按钮(重置所有表单值为默认值):
  <input type="reset">
  

 

  17.search:定义搜索字段(比如站内搜索或谷歌搜索等):

  Search Google: <input type="search" name="googlesearch">
  

  18.submit:定义提交按钮:

  <input type="submit">
  

  19.tel:定义用于输入电话号码的字段:

  电话号码: <input type="tel" name="usrtel">
  

  20.text:定义两个用户可向其中输入文本的单行的文本字段:

  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  

  21.url:定义用于输入 URL 的字段:

  添加你的主页: <input type="url" name="homepage">
  

  22.week:定义 week 和 year 控件(不带时区):

  选择周: <input type="week" name="week_year">

  

 

转载于:https://www.cnblogs.com/xyangjie/p/10868356.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<div class="table-container"> <table id="myTable"> <thead> <tr> <th contenteditable="true" ><input type="text" oninput="filterTable(1)" placeholder="aoiStep" ></th> <th contenteditable="true" ><input type="text" oninput="filterTable(2)" placeholder="defectType" ></th> <th contenteditable="true" ><input type="text" oninput="filterTable(3)" placeholder="layerCode" ></th> <th contenteditable="true" ><input type="text" oninput="filterTable(4)" placeholder="type"></th> <th contenteditable="true" ><input type="text" oninput="filterTable(5)" placeholder="dpet" ></th> <th contenteditable="true"><input type="text" oninput="filterTable(6)" placeholder="subcode" ></th> <th contenteditable="true" ><input type="text" placeholder="codeDescription" ></th> <th contenteditable="true" >image1</th> <th contenteditable="true" >image2</th> <th contenteditable="true">image3</th> <th contenteditable="true" >image4</th> <th contenteditable="true" >image5</th> <th contenteditable="true" ><input type="text" placeholder="determination_rule"></th> </tr> </thead> <tbody> <form action="unload.php" method="POST" enctype="multipart/form-data"> <tr> <td input type="text" name="aoi_step">3</td> <td input type="text" name="defect_type">Particle</td> <td input type="text" name="layer_code">ACT</td> <td input type="text" name="type">Particle</td> <td input type="text" name="dpet">ACT</td> <td input type="text" name="subcode">Particle</td> <td input type="text" name="code_description">ACT</td> <td> <input type="file" name="image1_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> <td> <input type="file" name="image2_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td> <input type="file" name="image3_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td> <input type="file" name="image4_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td> <input type="file" name="image5_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"> </td> <td input type="text" name="determination_rule">Particle</td> <tr> <button type="submit">提交</button> </tr> </form> </tbody> </div> <script>修改后在我提娜佳图片是报错
07-23
根据你提供的代码,我注意到你在表格嵌套了一个 `form` 元素。请注意,根据 HTML 规范,`form` 元素不能直接嵌套在 `tbody` 元素内部。你需要将 `form` 元素放置在 `table` 元素的外部。 此外,请确保在 `form` 元素添加正确的 `action` 属性和合适的 `method` 属性。根据你的代码,将表单提交到 `unload.php` 并使用 `POST` 方法进行提交。 修复后的代码示例: ```html <div class="table-container"> <form action="unload.php" method="POST" enctype="multipart/form-data"> <table id="myTable"> <thead> <tr> <th contenteditable="true"><input type="text" oninput="filterTable(1)" placeholder="aoiStep"></th> <th contenteditable="true"><input type="text" oninput="filterTable(2)" placeholder="defectType"></th> <th contenteditable="true"><input type="text" oninput="filterTable(3)" placeholder="layerCode"></th> <th contenteditable="true"><input type="text" oninput="filterTable(4)" placeholder="type"></th> <th contenteditable="true"><input type="text" oninput="filterTable(5)" placeholder="dpet"></th> <th contenteditable="true"><input type="text" oninput="filterTable(6)" placeholder="subcode"></th> <th contenteditable="true"><input type="text" placeholder="codeDescription"></th> <th contenteditable="true">image1</th> <th contenteditable="true">image2</th> <th contenteditable="true">image3</th> <th contenteditable="true">image4</th> <th contenteditable="true">image5</th> <th contenteditable="true"><input type="text" placeholder="determination_rule"></th> </tr> </thead> <tbody> <tr> <td><input type="text" name="aoi_step" value="3"></td> <td><input type="text" name="defect_type" value="Particle"></td> <td><input type="text" name="layer_code" value="ACT"></td> <td><input type="text" name="type" value="Particle"></td> <td><input type="text" name="dpet" value="ACT"></td> <td><input type="text" name="subcode" value="Particle"></td> <td><input type="text" name="code_description" value="ACT"></td> <td><input type="file" name="image1_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"></td> <td><input type="file" name="image2_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"></td> <td><input type="file" name="image3_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"></td> <td><input type="file" name="image4_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"></td> <td><input type="file" name="image5_path" onchange="previewImage(this);selectCell(this)" onclick="showPopup(this.src)" style="width: 100px; height: auto;"></td> <td><input type="text" name="determination_rule" value="Particle"></td> </tr> </tbody> </table> <button type="submit">提交</button> </form> </div> ``` 请注意,这只是修复了你提供的代码片段的问题。如果还有其他问题,请提供更多的代码和错误信息,以便我们能够更全面地帮助你。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值