从javascript更改LinkButton样式属性

change LinkButton style attribute from javascript

本文关键字:样式 属性 LinkButton 更改 javascript      更新时间:2023-09-26

我想通过javascript更改linkbuttonstyle attributejavascript,尝试为DropDownList工作,但不为linkbutton工作。

这是我的代码

            </asp:ListItem>
            <asp:ListItem Text="vikas" Value="0">
            </asp:ListItem>
        </asp:DropDownList>
        <asp:LinkButton ID="lnkbtnSave" Style="display: none" Text="Save" runat="server"></asp:LinkButton>
        <asp:LinkButton ID="lnkbtnCancel" Style="display: none" Text="Cancel" runat="server"></asp:LinkButton>
        <asp:TextBox ID="lnkbtnTest" Style="display: none" Text="hope" runat="server"></asp:TextBox>
        <asp:LinkButton ID="lnkbtnChangeHR" Text="Change Hiring Manager:" runat="server"
            OnClientClick="javascript:return Visible(this.id);"></asp:LinkButton>
    </div>
    <script type="text/javascript" language="javascript">
        alert('dil sambhal ja jara');
        function Visible(me) {
            alert(document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnTest")));
            document.getElementById(me.replace("lnkbtnChangeHR", "ddlHiringManager")).style.display = 'inline';
            document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnSave")).style.display = 'inline';
            document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnCancel")).style.display = 'inline';
            document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnChnageHR")).style.display = 'none';
            document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnSave")).style.color = "#f6f6f6";
            document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnCancel")).style.color = "#f6f6f6";
            document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnTest")).style.display = 'inline';
            alert(document.getElementById(me.replace("lnkbtnChnageHR", "lnkbtnCancel")).style.display == 'none');
            return false;
        }
    </script>

对不起,伙计们,这是PICNIC

是lnkbtnChangeHR而不是lnkbtnChnageHR