开发者社区 问答 正文

表单控件中textarea标签的特性值有哪些呢?

表单控件中textarea标签的特性值有哪些呢?

展开
收起
游客yzrzs5mf6j7yy 2022-03-14 23:19:14 478 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • <input id="btn1" type="button" value="禁用">
    <input id="btn2" type="button" value="启用">
    <input id="btn3" type="button" value="只读">
    <input id="btn4" type="button" value="读写">
    <textarea id="test">测试内容</textarea>
    <script>
        btn1.onclick = function(){
            test.setAttribute('disabled','');
        };
        btn2.onclick = function(){
            test.removeAttribute('disabled');
        };    
        btn3.onclick = function(){
            test.setAttribute('readonly','readonly');
        };
        btn4.onclick = function(){
            test.removeAttribute('readonly');
        };
    </script>
    
    2022-03-14 23:19:27 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等