美文网首页
1.8 (案例)input-output

1.8 (案例)input-output

作者: 柒月柒日晴7 | 来源:发表于2017-06-07 15:16 被阅读0次

效果展示:

input-output.png
<!DOCTYPE html>
<html>
<meta charset="utf-8" />
<body>

<!--
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)" id="form1">0
<input type="range" id="a" value="50" max="200">200
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form>
-->

 <form oninput = "x.value=parseInt(a.value)+parseInt(b.value)">
    0<input type="range" id="a" value="50">
    </input>+
    <input type="number" id='b' value= '50'/>
    =<output name="x" for = 'a b'></output>
</form>
<p><b>注释:</b>Internet Explorer 不支持 <output> 标签。</p>
    <script type="text/javascript">
        var oForm = document.getElementById('form1');
        var oA = document.getElementById('a');
        var str = [1,2,3]
        console.log(str.reverse())
        /*oForm.oninput = function(){
            console.log("input"+a.value)
        }
        oForm.onchange = function(){
            console.log("change"+a.value);
        }*/
    </script>
</body>
</html>

相关文章

网友评论

      本文标题:1.8 (案例)input-output

      本文链接:https://www.haomeiwen.com/subject/zfxafxtx.html