小编Tim*_*eux的帖子

在特定元素后查找 Div

我可以使用 .class textimage-text 获取元素内的所有 HTML。这很好用。然后我需要获取以下 Div 中的 html,该 Div 没有 id 或 Class。

例子

<div class="textimage-text">
  <p>Some Text goes here</p>
</div>
<br>
<div>
  <p>Some additional Text goes here</p>
</div>

$.get(item.url, function (html) {

  var body = $(html).find(".textimage-text").html(); // <- this works
  var more= $(html).find(".textimage-text").next("div").html(); // <- this does not work
Run Code Online (Sandbox Code Playgroud)

jquery element jquery-selectors

2
推荐指数
1
解决办法
4563
查看次数

标签 统计

element ×1

jquery ×1

jquery-selectors ×1