HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

replace

Description

The replace of DOMTokenList for JS replaces token with newToken.

Returns true if token was replaced with newToken; otherwise false.

Throws a "SyntaxError" DOMException if one of the arguments is the empty string.

Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.

Syntax

tokenlist.replace(token, newToken)

Parameters

token

A string.

newToken

A string.

Examples

1 · not replaced

2 · replaced

3 · return · false

4 · return · true