Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery:nextSibling未定义_Jquery_Html - Fatal编程技术网

jQuery:nextSibling未定义

jQuery:nextSibling未定义,jquery,html,Jquery,Html,如何获取下一个签名 这是我的密码: <div> <p class="vend1">81125</p> <p class="vend2">0</p> <br> </div> 它表示未定义 非常感谢 $(".vend1").hover(function(){ var vend2 = $(this).next('.vend2').html(); console.log(vend

如何获取下一个签名

这是我的密码:

<div>
    <p class="vend1">81125</p>
    <p class="vend2">0</p>
    <br>
</div>
它表示
未定义

非常感谢

$(".vend1").hover(function(){
    var vend2 = $(this).next('.vend2').html();
    console.log(vend2);
});
试试这个


next().sibbines()。
@Pekka,这显示了
81125
。我需要它显示
0
,如
class=“vend2”
nextSibling
是一个DOM属性,而不是jQuery方法。
$(".vend1").hover(function(){
    var vend2 = $(this).next('.vend2').html();
    console.log(vend2);
});
$(".vend1").hover(function(){
    var vend2 = $(this).next().html();
    alert(vend2);
});