DOMTokenList Validation Added in Chrome 50
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
In Chrome 50, you'll be able to check the support of options for some HTML attributes that are backed by DOMTokenList
instances in JavaScript.
Right now, these places are:
- iframe sandbox options
- link relations (the rel attribute, or relLink in JavaScript)
Let's show a quick example:
var iframe = document.getElementById(...);
if (iframe.sandbox.supports('an-upcoming-feature')) {
// support code for mystery future feature
} else {
// fallback code
}
if (iframe.sandbox.supports('allow-scripts')) {
// instruct frame to run JavaScript
// NOTE: this is well-supported, and just an example!
}
As the list of supported options grows and changes, you can use feature detection to perform the correct actions for your web applications.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2016-03-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2016-03-14 UTC."],[],[]]