【问题标题】:Hide table row when user clicks inside textbox当用户在文本框内单击时隐藏表格行
【发布时间】:2014-03-20 10:52:23
【问题描述】:

当用户点击文本框时如何隐藏表格行?

我试过了

$(document).ready(function () {
    $('#tcodeVar').focusin(function () {
        $('tr.trEventhide').hide();
    })
});

HTML:

<tr>
    <td>Code:</td>
    <td>
        <asp:TextBox ID="tcodeVar" runat="server"></asp:TextBox>
    </td>
</tr>
<tr id="trEventhide" runat="server">
    <td>Event?:</td>
    <td>
        <asp:DropDownList ID="DDLEvent2" runat="server"></asp:DropDownList>
    </td>
</tr>

【问题讨论】:

  • 问题不清楚..需要改写..!
  • 贴出相关的html代码。
  • 当用户在文本框内点击时,隐藏表格行?当用户在文本框中编辑某些文本时,表格行会被隐藏
  • 从描述和示例代码来看,它看起来足够好,请解释你遇到了什么错误,是的,就像其他所说的与之相关的帖子 html。
  • $('tr.trEventhide').hide();改成$('#trEventhide').hide();。你需要# id-selector

标签: jquery html asp.net css vb.net


【解决方案1】:

改变

$("tr.trEventhide").hide();

$("#trEventhide").hide();

你需要# id-selector


Learn jQuery

API Documentation

Selectors

【讨论】:

    猜你喜欢
    • 2012-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-28
    • 1970-01-01
    相关资源
    最近更新 更多