JSFiddle - React, Tailwind, and code Playground
HTML
Reference: <br>
<span class=hello>Hello</span> <span class=world>World</span>,
<span class=john>John</span> <span>Doe</span><br>
<br>Result: <br>
<span id=result></span>
JavaScript
let result = document.getElementById('result'),
hello = document.querySelector('.hello'),
world = document.querySelectorAll('.world')[0],
john = document.getElementsByClassName('john')[0],
doe = document.getElementsByTagName('span')[3]
result.innerHTML =
hello.innerHTML+` ${world.innerHTML}, ${john.innerHTML} `+doe.innerHTML