Style.display attribute manipulation _javascript techniques in JavaScript

Source: Internet
Author: User
Tags compact

Display version: Css1/css2 Compatibility: ie4+ ns4+ Inheritance: None

Syntax:

Display:block |   none |   inline |   Compact |   Marker |   inline-table |   List-item |   Run-in |   Table |table-caption |   Table-cell |   Table-column |   Table-column-group |   Table-footer-group |   Table-header-group |   Table-row | Table-row-group

Parameters:

The default value of the Block:css1 block object. Add a new row after using this value as an object
None:css1 hidden objects. Unlike the hidden value of the visibility property, it does not retain its physical space for the object being hidden
Inline:css1 the default value of the inline object. Use this value to delete rows from the object
Compact:css2 allocates objects as block objects or inline objects based on content
MARKER:CSS2 specifies that the content is before or after the container object. To use this parameter, the object must be used with: after and: before pseudo elements
Inline-table:css2 table as inline object or inline container without wrapping
LIST-ITEM:CSS1 Specifies the block object as a list item. And you can add an optional item flag
Run-in:css2 allocates objects as block objects or inline objects based on content
Table:css2 the object as a block element level table
Table-caption:css2 the object as a table caption
Table-cell:css2 the object as a table cell
Table-column:css2 the object as a table column
Table-column-group:css2 the object as a table column group
TABLE-HEADER-GROUP:CSS2 displays objects as table header groups
Table-footer-group:css2 Display objects as table footer groups
Table-row:css2 the object as a table row
Table-row-group:css2 the object as a table row group

Description:

Sets or retrieves whether and how the object is displayed.
Currently, IE5.5 only supports the above CSS1 parameters.
The corresponding script attribute is display. Please refer to other bibliographies I have written.

Here's an example: click Show or hide

Copy Code code as follows:

<script language= "JavaScript" >
function Show (str) {
var I=documeng.getelementbyid (str);
if (I.style.display = = "None") {
I.style.display = "";
}
else{
I.style.display = "None";
}
}
</script>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.