Difference between input [type = hidden] and visibility = "hidden"

What is the difference between input[type=hidden] and visibility : hidden; ?

+4
source share
4 answers

The first is an input element, and the second is used for style in CSS2.

visibility: hidden; The visibility property indicates whether the element is visible.

input [type = hidden] : - HIDDEN is the value of the TYPE attribute for the INPUT element for FORM. It indicates a form field that is not explicitly displayed in the document and that the user is not interacting with it. It can be used to transmit information about the status of a client or server.

+5
source

input[type=hidden] definitely a selector that matches every input element whose type attribute value is set to hidden .

I have no idea what visibility="hidden" . It could be a CSS property, but incorrect. It should be visibility: hidden; valid.

+2
source

Im suggesting that you mean the difference between <input type="hidden" /> and with CSS

 .hidden { display: none; } 

If this is the case, then the first one is a DOM type but is still in the structure, the second is a style method for removing an element from the DOM structure.

+2
source
 input[type=hidden] 

This is a DOM selector (jQuery, CSS, etc.) for any input elements where the type attribute is "hidden" . It has nothing to do with actually displaying or hiding these elements, except that browsers do not display <input type="hidden" /> elements.

 visibility="hidden" 

This sets the CSS visibility property to "hidden", which tells the browser not to display any elements (elements) to which you apply this attribute. This is all about displaying HTML elements and has nothing to do with selectors or form elements, as another example does.

+1
source

Source: https://habr.com/ru/post/1501079/


All Articles