You are here: Reference > JavaScript > client-side > ActiveX > HtmlDlgSafeHelper objects > objects > blockFormats

blockFormats collection

Browser support:
Represents a collection of available block format tags.


Properties that reference the object:

Possible members:

Returns an integer that specifies the number of available block format tags.

This property is read-only.
item (index)
Returns the name of a block format tag by index.


Required. Integer that specifies the position of the block format tag to retrieve. The index of the first element is 1.

Return value:

Returns a string that contains the name of the block format tag at the specified position.

Example HTML code 1:

This example illustrates the use of the blockFormats collection:
    <script type="text/javascript">
        function ShowBlockFormatTags () {
            var dlgHelper = document.getElementById ("dlgHelper");

            if (dlgHelper.blockFormats) {       // Internet Explorer
                var formatTags = "";
                for (var i = 1; i <= dlgHelper.blockFormats.Count; i++) {
                    formatTags += dlgHelper.blockFormats (i) + "\n";
                alert ("The number of block format tags is " + dlgHelper.blockFormats.Count);
                alert ("The list of block formats: \n" + formatTags);
            else {
                alert ("Your browser doesn't support this example!");
    <object id="dlgHelper" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object>              
    <button onclick="ShowBlockFormatTags ();">Show available block format tags!</button>
Did you find this example helpful? yes no

External links:

User Contributed Comments

Post Content

Post Content