使用JavaScript在按钮单击时隐藏ul,其中值也在按钮单击时插入到MySQL中
using javascript hide ul on button click, where value is inserted to mysql on button click also
如何在php中隐藏ul on button click ?>
<li style='width:115px;margin-left:7px;word-wrap:break-word;'><?php echo $row['title'];?></li>
<li style='width:90px;margin-left:7px;word-wrap:break-word;'><?php echo $row['status'];?></li>
<li style='width:80px;margin-left:7px;word-wrap:break-word;'><?php echo $row['added_date'];?></li>
<li style="width:40px;text-align:left;margin-left:5px;"><a href="<?php echo $url;?>?p=<?php echo $currentPage;?>&show=1&guest_id=<?php echo $guestId;?>&enquiry_id=<?php echo $enquiry_id;?>&pid=<?php echo $proposalId;?>" style="text-decoration:none;" >Edit</a></li>
<li style="width:70px;text-align:left;"><a id="link" name="link" href="addguestinformation.php?enq=<?php echo $row['enq_id'];?>&pid=<?php echo $proposalId; ?>" style="text-decoration:none;" >Booking</a></li>
<!--<li style="width:70px;text-align:left;"><button id="bookingconfirm" name="bookingconfirm" class="button" type="button" onclick="bookingForm(<?php //echo $row['enq_id']?>);">Booking</button>-->
</ul>
使用 jQuery 可以隐藏 Element UL
$('ul').on('click',function(){ this.fadeout('slow');//当你点击 Ul 时,这将隐藏 Ul });
to hide UL with attribute Id use
$('#hide').on('click',function(){ this.fadeOut('slow'); });
好吧,
单独使用php,如果不重新加载页面,您就无法做到这一点,现在它不是那么用户友好,但是有Jquery,这是一个JavaScript库,可以为您做到这一点
//Gets the referance of the DOM Object by using the ID
$('#hideButton').click(function(e){
//prevents the default action of the button
e.preventDefault();
//Hides the list
$('#foo').fadeOut('slow', function(b){
//What to do once the list has faded out
alert('hidden');
});
});
单击此处获取工作 JSfiddle
相关文章:
- 如何隐藏按钮单击事件上的占位符
- 从Web服务器下载图像按钮单击使用JavaScript
- 在SweetAlert中传递ASP.NET按钮单击事件
- 单选按钮单击可刷新/更改网站的小区域
- 调用按钮单击事件 ajax 加载的用户控件
- 附加 jQuery 代码以在加载和按钮单击时运行
- 在按钮单击时将图像URL数据显示到弹出框中,而无需禁用背景
- 按钮单击服务器单击
- 触发单选按钮单击,并在页面刷新时记住选择
- 如何使用 javascript 而不是使用控制器中的方法在 rails 中呈现部分按钮单击
- jQuery UI 选项卡 - 将参数设置为下一个/上一个按钮单击
- 如何在 Angular JS 中的按钮单击上添加类
- 当元素上有多个类时触发按钮单击事件
- 如何在 HTML 中的按钮单击上更改图像(IMG URL 每次来自服务器)
- 如何使用javascript刷新我的html页面时清除按钮单击
- 阻止后退按钮 - 单击按钮时忽略
- 如何制作按钮.单击“开始时不运行”
- Rails:尝试在按钮单击时渲染部分
- 在页面加载时调用函数,在按钮单击时再次调用函数,但参数不同
- 如何在服务器端的文本中添加按钮单击事件