function convertStringToHTMLElement(str, selector) {
  const doc = new window.DOMParser().parseFromString(str, 'text/html');
  return doc.body.querySelector(selector);
}
Make HTML element from string
@param {string} str - The string to convert to an HTML element.
@param {string} selector - The selector to use to get the element once it is created.
@returns {HTMLElement} - The HTML element that was created.