数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
450 B

"use strict";
const isDOMElement = require("./isDOMElement.js");
/**
* Find a DOM element.
*
* @param {Node|string} element
* @returns {Node|null}
*/
function findDOMElement(element, context) {
if (context === void 0) {
context = document;
}
if (typeof element === 'string') {
return context.querySelector(element);
}
if (isDOMElement(element)) {
return element;
}
return null;
}
module.exports = findDOMElement;