Answer the question
In order to leave comments, you need to log in
How to get text from an array?
I don’t even know how to describe it)) in general, there is a code for example:
let name = document.querySelector('.name'),
age = document.querySelector('.age'),
todo = document.querySelector('.todo'),
button = document.querySelector('.button');
let array = [name, age,todo]
button.addEventListener('click',()=>{
console.log()//сюда нужно вывести весь массив только ее текстовую часть
})
Answer the question
In order to leave comments, you need to log in
console.log(array .join(','));
only if you need a value, then you need to pull out value for example:let name = document.querySelector('.name').value;
Let 's go here and read.
The value attribute is a DOMString that contains the current value of the text entered into the text field. You can retrieve this using the HTMLInputElement value property in JavaScript.
let theText = myTextInput.value;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question