<style>
.text{color:#ffffff}
.button{color:#ccccc}
</style>
<input type=text class="text">
<input type=button class="button">

解决方案 »

  1.   

    to wuxinlangman(无心之尘 8.14号开始学习js技术不过关不要见怪) 
      我的需求是不要在input中绑定class属性 ,而是通过css选择符来设置。
      

  2.   

    无法,老实用class吧。想偷懒就用脚本,循环input,判断type,分别给class值。
    终归还是得用class,呵呵。
      

  3.   

    建议使用<button></button>
      

  4.   

    ie支持expressioninput{
      color:expression( this.type=="button"?"red":(this.type=="text"?"blue":"") );
    }