Z
Z
Zikrillo Abbosov2020-04-20 18:46:33
JavaScript
Zikrillo Abbosov, 2020-04-20 18:46:33

How to take data from HTML to Javascript?

<p id="word">Hello world</p>

You need to write a value to the slovo variable in JavaScript. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-04-20
@azymson

let slovo = document.querySelector('#word').textContent;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question