input 编辑属性设置

[复制链接]
查看11 | 回复3 | 2009-3-5 02:06:06 | 显示全部楼层 |阅读模式
当value=为空的时候可以编辑
不为空的时候 不能编辑
想在里面加个什么属性实现上面说的效果

回复

使用道具 举报

千问 | 2009-3-5 02:06:06 | 显示全部楼层
把下面的代码拷贝到你网页看看效果就明白了 if(document.getElementById('test1').value!=''){ document.getElementById('test1').disabled = 'disabled'; } if(document.getElementById('test2').val...
回复

使用道具 举报

千问 | 2009-3-5 02:06:06 | 显示全部楼层
?什么疑问这样啊,哪有这几位说这么麻烦,都用脚本了..直接在第二个文本框里加个只读属性: readonly="readonly" 即可.....
回复

使用道具 举报

千问 | 2009-3-5 02:06:06 | 显示全部楼层
...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行