【问题标题】:Selecting all rows for a give title选择给定标题的所有行
【发布时间】:2015-04-13 11:35:16
【问题描述】:

我有这样的行,

<tr onclick="LoadFruit(19210)" data-clisch="12-178" data-catid="88" data-rid="19210" data-start="02/03/2012 00:00:00" data-rstatus="Overdue" data-status="cbOpeks" class="ref" style="display: table-row;">
    <td class="rtddef hov">
        <div style="float:left">Fruitish Fruit 1</div>
        <div class="msb sub"><span style="float:right; padding-right: 5px;">Tmm itee</span>

            <div style="clear:both;"></div> <span style="float:left">Multi Dription 1</span><span style="float:right; padding-right: 5px; color:red">27 M015</span>

        </div>
    </td>
    <td class="rlicd">
        <div title="Weight = 2  Quality = 3">
            <img src="../_layouts/15/images/eControls.WebPart.Details/riskimporange.png" alt="Weight = 2  Quality = 3">
        </div>
    </td>
</tr>

我正在尝试选择表的所有行并将它们克隆到另一个表,我的目标是显示它们,但也许我需要更改 ID,但是我在创建选择查询时遇到问题,

我可以,

$("#table tr td[1] div") ... not sure what's next

我可以用它来克隆How to Copy Table Row with clone in jquery and create new Unique Ids for the controls,但这是在我做出选择语句之后。

【问题讨论】:

  • "a give title"是什么意思?

标签: javascript


【解决方案1】:

你可以简单地通过title的属性值选择元素,代码如下

$("div[title='Weight = 2  Quality = 3']")

【讨论】:

  • 它给了我 div,但我在行之后,我想选择 div title = this 的所有行
猜你喜欢
  • 1970-01-01
  • 2021-04-11
  • 2011-03-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-07
  • 2014-08-22
  • 1970-01-01
相关资源
最近更新 更多