Help with template strings in js

js template strings

balloonContent: `

  <div class="content">

     <!-- content -->

  </div>

`

markup should be only in js,
on html it shouldn’t be.
how can i find the class of this markup to hang a click event on it next function

thanks

Hi @Erbol and welcome to the community :wave:

To get the element in JS by its class name you would do something like this:

document.querySelector('.content')

This would select the element with class “content”. You can change the content of this element in JS like this:

<!-- just text -->
document.querySelector('.content').textContent = "Test";
<!-- HTML -->
document.querySelector('.content').innerHTML = "<h1>Test</h1>";

I hope I understood your question correctly. If not, maybe a link to the exercise (if any) would help. :slightly_smiling_face:

Have a nice day,
Michael