zoukankan      html  css  js  c++  java
  • 点击改变delelist的颜色

     function ChuanZhi(zhi) {
                var bian = document.getElementById("bian").value;
                if (bian.toString() == "") {
                    bian = zhi;
                }
                document.getElementById(bian).style.backgroundColor = "#66CCFF";
                document.getElementById(bian).style.color = "#000000";
                document.getElementById("FuZhi").value = zhi;
                document.getElementById("bian").value = zhi;
                document.getElementById(zhi).style.backgroundColor = "#0066CC";
                document.getElementById(zhi).style.color = "#FFFFFF"; 
            }
    <asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal"
                    RepeatColumns="7" Height="31px">
                    <ItemTemplate>
                        <div id="<%#Eval("id") %>" onclick="ChuanZhi(<%#Eval("id") %>)" style=" 80px;
                            height: 30px; line-height:30px; text-align: center; background-color: #66CCFF">
                            <%#Eval("ZhongWenMing")%>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
    <input type="hidden" id="bian" />
            <input type="hidden" id="zhoushu" />
  • 相关阅读:
    linux服务篇
    降智比赛题解
    CF 1437 题解
    ZR 2020普转提七连测day5
    20联赛集训day11 题解
    contest5 题解
    20联赛集训day9 题解
    20联赛集训day8 题解
    contest4 题解
    20联赛集训day7 题解
  • 原文地址:https://www.cnblogs.com/a1235202005/p/2672158.html
Copyright © 2011-2022 走看看