You are here: Reference > JavaScript > client-side > HTML DOM > properties > isMultiLine

isMultiLine property

Browser support:
Returns a Boolean value that indicates whether the contents of an element can be multiline or not.

Syntax:

object.isMultiLine;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Boolean that indicates whether there can be multiple lines in the element's contents.
One of the following values:
false
The element cannot contain multiline content.
true
The element can contain multiline content.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the isMultiLine property:
<head>
    <script type="text/javascript">
        function IsMultiline (elem) {
            var msg = (elem.isMultiLine == true)? "yes" : "no";
            alert (msg);
        }
    </script>
</head>
<body>
    <input type="text" id="myInput" value="Input"/>
    <button onclick="IsMultiline (myInput);">Can this field have multiple lines?</button>
    <br />

    <textarea id="myTArea">Textarea</textarea>
    <button onclick="IsMultiline (myTArea);">Can this field have multiple lines?</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content