I have a html string like this which response from API:
const response = `
<html>
<head>
<title></title>
</head>
<body>
<code>Value I want to get<br></code>
</body>
</html>
`;
So the content maybe dynamic but the tag <code> is unique. I want to have some more solutions on this to see what is the best solution.
document.getElementsByTagName("code")is what you should be looking for<code>by document.