const myHTML = (<div> <h1 id="myTitle"> hello </h1> </div>)
My goal is to get an attribute from the h1 in the code above. My current approach looks something like this:
const myHTML = (<div> <h1 id="myTitle"> hello </h1> </div>)
const width = myHTML.querySelector("#myTitle");
This returns the error:
myHTML.querySelector is not a function
I am making this project with React, tailwindcss and visx if that's relevant;