javascript - 从 javascript 更改 LinkBut​​ton 样式属性

标签 javascript asp.net html css

我想通过javascript改变linkbuttonstyle attribute javascript,尝试为 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

关于javascript - 从 javascript 更改 LinkBut​​ton 样式属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15826583/

相关文章:

javascript - 如何在文档的 <head> 部分创建 Angular 指令?

javascript - 使用 jquery 在 svg 中选择图像

javascript - 当选择A改变时改变选择B的div

c# - 我现在如何通过时间字符串和日期时间来获得差异?

html - 我可以将 HTML 作为 XML 存储在 Sqlite3 数据库中吗?

html - 如何管理队列中到 Flask 服务器的请求?

javascript - 将实际操作应用于右键单击上下文菜单

c# - 如何获取字符串的前五个字符

javascript - JQuery - 复选框的返回值

html - 你能设计一个 noscript 元素吗?