<script type="text/javascript"> function selectLists(all)
{
    var inputs = document.getElementsByTagName("input");
    for (var i = 0; i < inputs.length; i++)
    {
     var input = inputs[i];
       if (input.type == "checkbox" && input.className == "listcheckbox")
       {
         var id = input.id.substring(8);
         var row = document.getElementById("row" + id);
        input.checked = all;
         updateHighlight(input, row);
}
}
}



function updateHighlight(checkbox, row)
{
//alert("Check box is clicked");
if (checkbox.checked)
{
row.style.backgroundColor = "#ffffcc";
OneNewPart.Selected = TRUE;
}
else
{
row.style.backgroundColor = "#9999FF";
OneNewPart.Selected = FALSE;
}
}</script>

解决方案 »

  1.   

    作用就是给你的选中的select和listcheckbox换一个样式。
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sample</title>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript"> function selectLists(all) 

        var inputs = document.getElementsByTagName("input"); 
        for (var i = 0; i < inputs.length; i++) 
        { 
        var input = inputs[i];
          if (input.type == "checkbox" && input.className == "listcheckbox") 
          { 
            var id = input.id.substring(8); 
            var row = document.getElementById("row" + id); 
            input.checked = all; 
            updateHighlight(input, row); 
          } 
        } 
    } function updateHighlight(checkbox, row) 

    //alert("Check box is clicked"); 
    if (checkbox.checked) 

    row.style.backgroundColor = "#ffffcc"; 
    //OneNewPart.Selected = TRUE; 

    else 

    row.style.backgroundColor = "#9999FF"; 
    //OneNewPart.Selected = FALSE; 

    } </script>
    </head>
    <body>
    <input type=button value="All" onclick="selectLists(true);">
    <input type=button value="Reset" onclick="selectLists(false);">
    <input type=checkbox class="listcheckbox" id=abcdefgh1><b id=row1 >aaa</b>
    <input type=checkbox class="listcheckbox" id=abcdefgh2><b id=row2 >bbb</b>
    </body>
    </html>
      

  3.   

    Web 开发常用手册JScript语言参考.rar
    http://download.csdn.net/source/308916DHTML参考手册.rar
    http://download.csdn.net/source/308913样式表中文手册.chm
    http://download.csdn.net/source/304124边查手册边研究!