【问题标题】:Finding value by specifying the class name [duplicate]通过指定类名来查找价值[重复]
【发布时间】:2013-01-13 04:39:12
【问题描述】:

可能重复:
jquery get field value of a telerik row(grid) by its class

我在 MVC3 上使用 Telerik

我的网格有(事件“onRowSelect(e)”):

e.row.cells[1].innerHtml //包含“myValue”

e.row.cells[1].className //包含“myClass”

如何根据className找到innerHtml (jQuery - Find()?)

【问题讨论】:

  • 你试过 .find() 还是不知道它是如何工作的?
  • 你不是already ask this question吗?
  • 你可以试试$(classname).text(),它会根据类返回给你的值
  • $(e).find('myclass').html();
  • 我删除了上一个问题。

标签: jquery html asp.net-mvc-3 telerik


【解决方案1】:

HTML:

  <div class="myDiv">Some text</div>

jQuery:

$(document).ready(function() {
  alert($('.myDiv').text());
});

将输出:

一些文字

【讨论】:

    【解决方案2】:

    感谢上帝,

    感谢大家,

    从大家的cmets中,我找到了正确答案:

    $(e.row).find('myClass').text();
    

    【讨论】:

      猜你喜欢
      • 2021-12-19
      • 1970-01-01
      • 2018-03-03
      • 2020-11-30
      • 1970-01-01
      • 1970-01-01
      • 2014-08-05
      • 2022-01-21
      • 2021-01-07
      相关资源
      最近更新 更多