zoukankan      html  css  js  c++  java
  • label绑定数据

    查看实例:

    1. <html>  
    2. <head>  
    3. <title>test</title>  
    4. <meta http-equiv="content-Type" content="text/html;charset=utf-8">  
    5. </head>  
    6. <body>  
    7. <form>  
    8.   
    9. //第一种:  
    10. //文字必须是label标签内,checkbox的id和<label>标签内的for=""中的名字必须相同.  
    11. <input type="checkbox" id="check1" value="go" name="name">  
    12. <label for="check1">姓名</label
    13. <input type="checkbox" id="check2" value="on" name="name">  
    14.  <label for="check2">密码</label>  
    15. //第二种:  
    16. //把文字和checkbox包含在<label>标签内  
    17. <label>测试<input type="checkbox" id="11" /></label>  
    18. </form>  
    19. </body>  
    20. </html>  

    注意事项:文字必须是label标签内,checkbox的id和<label>标签内的for=""中的名字必须相同.

    vue中label实现绑定:

    1、多选绑定一个数组

    <div id="dong">
      <span>{{message}}</span>=<span v-text="message"></span>
      <span v-html="msgHtml"></span>
      <hr>
      <p>
        <input type="checkbox" value="pp" v-model="web_names" id="one">
        <label for="one">pan</label><br/>
        <input type="checkbox" value="gg" v-model="web_names" id="twe">
        <label for="twe">gg</label><br/>
        <input type="checkbox" value="ww" v-model="web_names" id="three">
        <label for="three">ww</label><br>
        <input type="checkbox" value="vv" v-model="web_names" id="four">
        <label for="four">vgo</label>
        <p>{{web_names}}</p>
      </p>
    </div>
    var dong=new Vue({
      el:'#dong',
      data:{
        message:'hello vue!',
        msgHtml:'<h2>hello vue</h2>',
        web_names:[]
      }
    })
    2、单选绑定一个数组
  • 相关阅读:
    BizTalk 2010 Adapter for mySAP Business Suite 所支持版本
    BizTalk Adapter Pack for Oracle 实现Oracle 11g的CRUD
    BizTalk 360 功能介绍 CTP版
    以小见大——那些基于 protobuf 的五花八门的 RPC(5 完)
    BizTalk Server 2010 + SQL Server 2008 R2 通过集成创造更大价值 [ 上篇 ]
    double to float
    Office 2003 PIA
    matlab传参数
    Convert.ToInt16
    矩阵转换
  • 原文地址:https://www.cnblogs.com/fengup/p/7440429.html
Copyright © 2011-2022 走看看