动态改变css样式,比如:
document.getElementById("hehe").style.fontWeight='bold';

解决方案 »

  1.   

    <html> 
    <head> 
    </head> 
    <body> 
    <input type=button  value="加粗" onClick="changeStyle();";> 
    <textarea id="hehe"> 
    ahdfaljfasdf as 
    </textarea> 
    </body> 
    </html>
    <script>
    function changeStyle()
    {
    document.getElementById("hehe").style.fontWeight='bold';
    }
    </script>
      

  2.   

    用document.getElementById("hehe").style.fontWeight='bold';就可以了!~
      

  3.   

    谢谢各位高手,解决了,zou_wei_forever,jeff__lueny ,DiscussQuestions ,double22822 都是正确的,散分了。