function
matchesSelector(element, selector) {
if (element.matchesSelector) {
console.log("matchesSelector")
return element.matchesSelector(selector);
} else if (element.msMatchesSelector) {
console.log("msMatchesSelector")
return element.msMatchesSelector(selector);
} else if (element.mozMatchesSelector) {
console.log("mozMatchesSelector")
return element.mozMatchesSelector(selector);
} else if (element.webkitMatchesSelector) {
console.log("webkitMatchesSelector")
return element.webkitMatchesSelector(selector);
} else {
console.log("error");
throw new Error("Not supported.")
}
}
网友评论