← Back to release summary

DOMTokenList replace()

Category
DOM
Type
New or changed feature
Status
Enabled by default (Chrome 61)
Intent stage
None

Summary

Add the replace() function to DOMTokenList interface. We can use it like element.classList.replace('inactive', 'active').

Standards & signals

Docs: https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/replace

View on chromestatus.com