html.twig: using JavaScript/jQuery

I like to use jQuery in twig templates.
What im trying is to retrieve values from textfields like {{ content.body }}

My first idea was to write script tags in the template “node–yamlform.html.twig”
and assign the values to variables like

<script>
var temp = "{{ content.body }}";
console.log(temp);
</script>

But that doesn’t work.
I can’t go out of the script tags to change something.
Is there a way to do that in the template file?

Thanks for your help!
Stefan

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/3/feed