Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.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
Php 在其他Div中替换Div文本_Php_Jquery_Wordpress - Fatal编程技术网

Php 在其他Div中替换Div文本

Php 在其他Div中替换Div文本,php,jquery,wordpress,Php,Jquery,Wordpress,我希望class=hotelname在class=a和class=hotelname中的回显文本是隐藏的。可能吗?我使用了jQuery代码,但它不起作用 <form id="" class="" method="GET" action="http://localhost/blue_bucket/county/" enctype="multipart/form-data"> <h2 class="a"></h2> <?php

我希望class=hotelname在class=a和class=hotelname中的回显文本是隐藏的。可能吗?我使用了jQuery代码,但它不起作用

<form id="" class="" method="GET" action="http://localhost/blue_bucket/county/" enctype="multipart/form-data">
        <h2 class="a"></h2>
    <?php
    foreach ($query as $row) 
    {   
        ?>
        <h3 class="hotelname"><?php echo $hotelnames =  $row->hotel; ?></h3>

        <div class="book-it-btn">
            <button type="submit" name="submit" class="btn btn-default">Apply</button>
        </div>
    </form>
        <?php
    }
    ?>  

根据我的理解,您需要将.hotelname类值放入。一个类,然后您要隐藏.hotelname类元素吗

检查下面的工作代码段

$document.readyfunction{ var hotelName=$.hotelName.text; $.a.texthotelName $.hotelname.hide; } 我的酒店 申请
问题没有明确说明。更具体地说你想要什么。我无法理解你的问题。你将得到多次上课
jQuery(".a").append(jQuery(".hotelname").html());
 var hotelName = $(".hotelname").text();

      $(".a").text(hotelName);