Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.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
Javascript 从包含html的变量中获取特定值_Javascript_Jquery_Jquery Ui - Fatal编程技术网

Javascript 从包含html的变量中获取特定值

Javascript 从包含html的变量中获取特定值,javascript,jquery,jquery-ui,Javascript,Jquery,Jquery Ui,下面是采用最接近同级值的脚本 var owner=$(this).closest('td').sibbines('td.select_fly').html() 下面是所有者变量的输出 现在我想从所有者变量中获取BLR,您能帮我解决这个问题吗:( 航班235 BLR 您可以通过以下方式使用find()获得它: $(owner).find("span").text(); 或直接: var spanText = $(this).closest('td').siblings('td.select_fl

下面是采用最接近同级值的脚本

var owner=$(this).closest('td').sibbines('td.select_fly').html()

  • 下面是所有者变量的输出

  • 现在我想从所有者变量中获取BLR,您能帮我解决这个问题吗:(

    航班235 BLR


    您可以通过以下方式使用
    find()
    获得它:

    $(owner).find("span").text();
    
    或直接:

    var spanText = $(this).closest('td').siblings('td.select_fly').find("span").text();
    
    var spanText = $(this).closest('td').siblings('td.select_fly').find("span").text();