Opera - 防止输入焦点 [英] Opera - Prevent input from having focus

查看:109
本文介绍了Opera - 防止输入焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在其中一个页面上隐藏了一个输入,并且隐藏起来,我的意思是可见,但看起来像纯文本。



http://jsfiddle.net/imoda/nVhp8/



<但我不希望用户能够点击并编辑信息。基本上禁用它,但不要将它设置为html中的 disabled 。我认为我很接近,但无论我尝试过什么都不行。



似乎除Opera之外的所有功能都可以使用。请帮忙吗?

解决方案

为了不使用jQuery,为什么不简单地使用 readonly 属性,一旦编辑按钮被点击就删除该属性?






I have a hidden input on one of my pages, and by hidden, I mean visible, but just looks like plain text.

Take for example http://jsfiddle.net/imoda/nVhp8/

But I don't want a user to be able to click in it and edit the information. Essentially disabling it, but without setting it to disabled in the html. I think I'm close but whatever I've tried isn't working.

Seems to work in everything except Opera. Help please?

解决方案

Instead of using jQuery, why not simply use the readonly attribute, removing that attribute once the edit button has been clicked?

JS Fiddle.

References:

这篇关于Opera - 防止输入焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆