I'm trying to add a variable that contains an html element in my html file, I'm trying to use innerHTML + = myvar, the problem is, I have two elements to add, an iframe, and a paragraph when I add iframe goes but the paragraph does not add.
function inserir() {
let nomeVideo = document.querySelector('#nome-video').value;
let linkVideo = document.querySelector('#link-video').value;
let itemVideo = '<div class="items-video">
<iframe src="${linkVideo}" frameborder="0" allowfullscreen>
<p>${nomeVideo}</p>
</div>';
document.querySelector('#conteudo-videos').innerHTML += itemVideo;
}
<!--html-->
<div class="container-items" id="conteudo-videos">
</div>
What can I be doing wrong? remembering that I'm starting now in javascript, so please forgive noobise.