Php 在其他Div中替换Div文本
我希望class=hotelname在class=a和class=hotelname中的回显文本是隐藏的。可能吗?我使用了jQuery代码,但它不起作用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
<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);