问题如下:input有初始背景图片,想鼠标点击后变成另外一张背景图片。
请高手指点

解决方案 »

  1.   

    设置点击事件,将背景图片的URL换掉
      

  2.   

    <script>
    function changePic(obj){
        obj.style.background="url(youpic.jpg) center center no-repeat"  //youpic.jpg换成你的图片的url
    }
    </script>
    <input type="text" style="background:url(http://www.v-ec.com/ijc/ajax-loader.gif) center center no-repeat" onclick="changePic(this)">
      

  3.   

    设置背景图片后,input里光标不在中间,上移了些,如何控制啊
      

  4.   

    在input的style里设置 line-height:XXpx  来调整