driver.js / src /common /utils.js
kamrify's picture
WIP - Remove canvas and use HTML/CSS
bdfd65a
raw
history blame
386 Bytes
/**
* Turn a string into a node
* @param {String} htmlString to convert
* @return {Node} Converted node element
*/
// eslint-disable-next-line
export const createNodeFromString = (htmlString) => {
const div = document.createElement('div');
div.innerHTML = htmlString.trim();
// Change this to div.childNodes to support multiple top-level nodes
return div.firstChild;
};