HTML - DOM Style Object quotes Property



HTML DOM Style Object quotes property sets or returns the type of quotation marks for embedded quotations.

Syntax

Set the quotes property:
object.style.quotes= "none | string string string string | initial | inherit";
Get the quotes property:
object.style.quotes;

Property Values

Value Description
none It is the default value which specifies that open quote and close quote values will not produce any quotation marks.
string string string string It is used to specify the quotation mark which is to be used. The first two values specifies first level of quotation embedding while the second two values specifies second level of quote embedding.
initial It is used to set this property to it's default value.
inherit It is used to inherit the property of it's parent element.

Return Value

It returns a string value which represents type of quotation marks for embedded quotations.

Example of HTML DOM Style Object 'quotes' Property

The following example sets different quotation mark for text written inside q element.

<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        HTML DOM Style Object quotes Property
    </title>
</head>
<body>
    <p>
        Click to change quotation mark.
    </p>
    <button onclick="fun()">Change</button>
    <button onclick="funTwo()">Change</button>
    <br>
    <q id="quo">
        Welcome to Tutorials Point
    </q>
    <script>
        function fun() {
            document.getElementById("quo")
                .style.quotes = "'\253' '\273'";
        }   
        function funTwo() {
            document.getElementById("quo")
                .style.quotes = "'<' '>'";
        }       
    </script>
</body>
</html>

Supported Browsers

Property Chrome Edge Firefox Safari Opera
quotes Yes 11 Yes 12 Yes 1.5 Yes 9 Yes 4
html_dom.htm
Advertisements