使用.prop在JQuery中隐藏按钮(隐藏:真) [英] Hiding button in JQuery using .prop(hidden: true)

查看:1130
本文介绍了使用.prop在JQuery中隐藏按钮(隐藏:真)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何隐藏与使用JQuery的.prop(隐藏:真)按钮的方法。出于某种原因,在Chrome当我设置这个值和查看HTML,按钮有一个隐藏的元素,但按钮依然显示在页面上为可见。

I am trying to figure out how to hide a button with JQuery using the .prop(hidden: true) method. For some reason, in Chrome when I set this value and view the html, the button has a hidden element, but the button still shows up as visible on the page.

任何想法?

推荐答案

一个按钮一点儿也不具有隐藏属性?

A button does'nt have a hidden property ?

$('button').hide();

$('button').toggle(true);  //shows button
$('button').toggle(false); //hides button

这篇关于使用.prop在JQuery中隐藏按钮(隐藏:真)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆