DOMStringList: contains() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("DOM")}}{{AvailableInWorkers}}
The **contains()** method returns a boolean indicating whether the given string is in the list.
Syntax
js-nolint
contains(string)Parameters
string- : A string you want to check for the existence of in the list.
Return value
A boolean indicating whether the given string is in the list.
Exceptions
- {{jsxref("TypeError")}}
- : Thrown if no argument is provided.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}