小编Mal*_*alo的帖子

禁用html中的输入

我在Javascript和Jquery手机中创建了8个益智盒游戏.我已经完成了一个盒子,<input readonly></input>我把所有这些都放在9x9的桌子上.问题是,当我点击一个框来移动它时,即使它是只读的,移动设备也会尝试在其中写入并显示键盘.这不是我想要的......我想禁用输入或使用不同的东西<input>.我尝试使用disable ="disabled"但仍然无法正常工作.这是代码:

<form name="box">
    </center>
    <table align="center">
        <tr>
            <td ><input name="casella1" value="8" onClick="test(this.value)" readonly style="text-align: center; width:50px; height:50px; font-weight:bold; background-color: #C0C0C0; border-style: solid; border-color: black"></td>
            <td ><input name="casella2" value="5" onClick="test(this.value)" readonly style="text-align: center; width:50px; height:50px; font-weight:bold; background-color: #C0C0C0; border-style: solid; border-color: black"></td>
            <td ><input name="casella3" value="2" onClick="test(this.value)" readonly style="text-align: center; width:50px; height:50px; font-weight:bold; background-color: #C0C0C0; border-style: solid; border-color: black"></td>
        </tr>
        <tr>
            <td ><input name="casella4" value="6" onClick="test(this.value)" readonly style="text-align: center; width:50px; height:50px; font-weight:bold; background-color: #C0C0C0; border-style: …
Run Code Online (Sandbox Code Playgroud)

javascript jquery html5 input disabled-input

4
推荐指数
1
解决办法
5231
查看次数

标签 统计

disabled-input ×1

html5 ×1

input ×1

javascript ×1

jquery ×1