xhtml里面有个Button,value是“加粗斜体按钮” ,其中 “加粗”是加粗过的 , “斜体”显示为斜体的, “按钮”为正常格式,哪个高手帮忙下  谢谢了

解决方案 »

  1.   

    <button type="reset">
       <b>加粗</b><i>斜体</i>按钮
    </button>
      

  2.   

    http://blog.csdn.net/sunxing007/archive/2009/07/23/4374693.aspx
    <html>    
        <head>    
            <title>Format Brush</title>  
        </head>  
        <style>  
          table{   
            border: solid #ccc 1px;   
               
          }   
          td{   
            border: solid #ccc 1px;   
            width: 140px;   
            height: 25px;   
          }   
          .selected{   
            border: solid red 1px;   
          }   
          a{   
            text-decoration: none;   
            color: black;   
            font-weight: bold;   
          }   
          .b{   
          }   
          .i{   
            font-style: italic;   
          }      
        </style>  
        <body>    
    <div>  
    <a href="javascript:setBold();" class='b'>加粗</a> &nbsp;&nbsp;   
    <a href="javascript:setItalic();" class="i">斜体</a> &nbsp;&nbsp;  
    </div>  
    <table id='t' cellpadding='0' cellspacing='0' border='1'>  
     <tr><td  class="selected">column1</td></tr>   
    </table>  
        </body>  
    <script>   //辅助函数   
      function $(id){return document.getElementById(id);}   
      var tb = $('t');   
      var selectedCell = tb.rows[0].cells[0];//当前被选择的单元格。   
      var brushing = false;//是否正在使用刷子   
      
      function setBold(){   
        selectedCell.style.fontWeight = "bold";   
      }   
      function setItalic(){   
        selectedCell.style.fontStyle = "italic";   
      }   
       //格式拷贝   
      function copyFormat(source, dist){   
        dist.style.fontWeight = source.style.fontWeight;   
        dist.style.fontStyle = source.style.fontStyle;   
        dist.style.textDecoration = source.style.textDecoration;   
        dist.style.color = source.style.color;   
      }   
      function doBrush(e){   
        if(!brushing){   
          $('tip').style.display = '';   
        }   
        else{   
          $('tip').style.display = 'none';   
        }   
        brushing = !brushing;   
      }   
         
         
      document.body.onload = function(){   
       for(var i=0; i<tb.rows.length; i++){   
           for(var j=0; j<tb.rows[i].cells.length; j++){   
             tb.rows[i].cells[j].onclick = function(){   
               if(brushing){   
                 copyFormat(selectedCell, this);   
               }   
             };   
           }   
       }   
      }   
      
    </script>  
    </html>  
      

  3.   

    只要闭合的嵌套就可以了
    <Button><B><I>value</I></B></Button>