title: How to get element from HTML stored in variable
body: <p>I am running an API to retrieve email from external system. I managed to get HTML code from the returned JSON and store it in a variable. Now, I would like to run some further operations on this HTML - for example get all elements with 
  <code>[data-type="whatever"]</code>.<br>
   It would be easy in html document:</p>
  
  <pre><code>var x = document.querySelectorAll('[data-type="whatever"]');
  </code></pre>
  
  <p>However the HTML document I want to work with is stored in the variable so the code I write in API does not recognise it as a document. How can I do it? Any suggestions with vanilla JS?</p>