2014-01-21 59 views
0

工作,我试过CSS输入[类型= “提交”] [禁用]是不是在Firefox

input[type="button"][disabled="disabled"]{ 
     color:gray !important; 
} 

这个CSS在我的代码它在IE工作,但不能在Firefox。

这是不适用于Firefox的CSS ..?

我的HTML代码

<input type="button" id="submit" value="Submit"></input> 
<script location="body"> 
document.getElementById("submit").disabled=true; 
</script> 

请帮助我..

+2

标题和问题中的标记是不同的。你有一个包含相关标记和样式的jsfiddle吗? – StuperUser

+2

为什么'[disabled =“disabled”]'而不仅仅是[[disabled]]? – Spudley

+0

适用于我http://jsfiddle.net/cLbJy/ –

回答

0

一些代码片段:将帮助您了解您所做的省略。

<html> 
    <head> 
     <style type="text/css"> 
      input[type="button"][disabled="disabled"]{ 
       color:gray !important; 
      } 
     </style> 

     <script type="text/javascript"> 
      function myFunc() { 
       document.getElementById("myButton").disabled = true; 
      } 
     </script> 
    </head> 

    <body onload="myFunc()"> 
     <input id="myButton" type="button" value="Hello"/> 
    </body> 
</html> 
+0

非常感谢你的回复,但是,是否有必要在html中添加禁用属性。我正在通过JavaScript禁用按钮.. – user2907330

+0

我做了更改,请再次查看 – emilan

+0

好的,谢谢你,我会试试这个先生。 – user2907330

相关问题