Options: i) visibility: hidden / visible
ii)display: none/inline/block
Difference : "visibility" will occupy the screen space even if it is hidden. But "display" will not take up any screen space if it is invisible(display:none).
NB: Use 'display' attribute more, as on need basis the screen space will be occupied.
2. readonly vs disbaled
Both of the above attributes can be used to make the HTML elements non-editable.
But the additional thing that Disabled does is, the user cant even highlight to copy the text, not to select the checkbox etc. Also those disabled fields are not been submitted to the server, in subsequent post backs.
So better to use disabled, if we want to make the control readonly as well as in accessible by the user in all means. :-)
For Example:
Sample - 1 | produces this |
| |
|
READONLY
READONLY
CHECKED
DISABLED
Sample -2 | produces this |
| Krishna Rama |
| Krishna Rama |
No comments:
Post a Comment