zoukankan      html  css  js  c++  java
  • output和textarea

    输出计算结果:output

    <!DOCTYPE>
    <html>
    <head>
    	<meta charset="utf-8">
    </head>
    <body>
    	<form oninput="x.value=parseInt(a.value)+parseInt(b.value)" method="post">
    		<input type="range" id="a" value="50" min="0" max="100">100 + 
    		<input type="number" id="b" value="50"> =
    		<output name="x" for="a b"> 100</output>
    		
    	</from>
    </body>
    </html>
    

    接收多行文本输入:textarea

    <!DOCTYPE>
    <html>
    <head>
    	<meta charset="utf-8">
    </head>
    <body>
    	<form method="post">
    		<textarea>I am the bone of my sword.
    Steel is my body,and fire is my blood.
    I have created over thousand blades.
    Unknown to death,
    Nor known to life.
    Have with stood pain to create many weapons.
    Yet,those hands will never hold anything.
    So as I pray,unlimited blade works.</textarea>
    	</from>
    </body>
    </html>
    
    • rows和cols属性来调整框的大小,单位是字符
    <!DOCTYPE>
    <html>
    <head>
    	<meta charset="utf-8">
    </head>
    <body>
    	<form method="post">
    		<textarea rows="10" cols="45">I am the bone of my sword.
    Steel is my body,and fire is my blood.
    I have created over thousand blades.
    Unknown to death,
    Nor known to life.
    Have with stood pain to create many weapons.
    Yet,those hands will never hold anything.
    So as I pray,unlimited blade works.
    		</textarea>
    	</from>
    </body>
    </html>
    
    • wrap,有3个值:soft,hard,off

      • soft:会自动换行,但不提交换行符
      • hard:会自动换行,但提交换行符,如何设置了hard,则必须同时指定cols属性
      • off:不会自动换行
  • 相关阅读:
    Ubuntu安装软件问题的解决
    寻找两个字符串中最长的公共部分字符串
    CentOS
    vim自定义配置
    git创建远程仓库以及在本地提交到远程仓库的方法
    黑金开发板在NiosII环境下烧写image到flash失败的解决办法
    f.lux 一款免费的护眼开源软件
    python 制作自动化脚本
    修改python 默认的存储路径
    第一篇博客
  • 原文地址:https://www.cnblogs.com/fate-/p/14378930.html
Copyright © 2011-2022 走看看