--- title: DOMString slug: Web/API/DOMString translation_of: Web/API/DOMString ---
DOMString є 16-бітовою послідовністю безнакових цілих, типово інтерпретуєтьсят як UTF-16 code units. Це точно відповідає до JavaScript примітивному типу String. Коли DOMString застосовється у JavaScript, це напряму відображує відповідну {{jsxref("String")}}.
When a Web API accepts a DOMString, the value provided will be stringified, using the ToString abstract operation. (For types other than Symbol, this has the same behavior as the {{jsxref("String/String", "String()")}} function.)
Certain Web APIs accepting a DOMString have an additional legacy behavior, where passing {{jsxref("null")}} stringifies to the empty string instead of the usual "null".
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('WebIDL', '#idl-DOMString', 'DOMString')}} | {{Spec2('WebIDL')}} | |
| {{SpecName('WebIDL', '#es-DOMString')}} | {{Spec2('WebIDL')}} | This defines how JavaScript values are converted to DOMString and vice versa. |