in textarea the contents of all input fields separated by commas. Use setinterval. (When entering data in the input - they are displayed in the textarea)
The problems is
1. When I just click on the field, 3 commas is appearing, but every comma should appear only after entered text.
2. How to do that the last comma after value didn't appear?
Thank you!
like if (inputs[i].value != "") { text += inputs[i].value + ', '; }
If you want to show only on input they why using setinterval just add oninput or onchange event Then just add condition like this one
Thank you a lot!!!☺️
but Pranav has a point. instead using an interval you could update the big textfield by using onipnput or onchange that way you could eliminate the last comma with ease as well
I'm still only at the beginning, so here task without events yet. Therefore emulated by setInterval.
Or I didn't get something?)🤔 About that last comma decided to ask a teacher, maybe let it be there, in case of adding more fields, for example)))😁 Than will not touch it)))
There should be no comma after the last one. Omg)))😱
thats what i tought ^^' you could to a i'd say rather quick and dirty solution and change if (inputs[i].value != "") { text += inputs[i].value + ', '; } to if (inputs[i].value != "") { text += inputs[i].value; if (inputs.length < i) { text += ', '; } }
Thank you a lot!)
can you make a screenshot like this again ?
Haaa, interesting)😃
wow) That's cool)
This is a terrible way to teach 🤦♂️
Обсуждают сегодня