When you click on the button to copy the text from the selected checkboxes in another window?

Good afternoon.
When you click on the button to copy the text from the selected checkboxes in another window.
That is when a person checks the box, for example, on selected products, click on the button and selected items are copied to another large window.
How to implement it? It is very important.
<input id="iq_form_blank18343301" type = "checkbox" value = "Value1">Value1
<input id="iq_form_blank18343302" type = "checkbox" value = "Value2">Value2
<input id="iq_form_blank18343303" type = "checkbox" value = "Value3">Value3
<input id="iq_form_blank18343301_send" type = "button" value = "Send">
<input id="question_text_value"type = "text" value = "">
<input id="iq_form_blank18343301_email" type = "button" value = "Send mail">

#question_text_value {
 height: 100px;
}

document.getElementById("iq_form_blank18343301_send").addEventListener("click", function() {
 document.getElementById("question_text_value").value = document.getElementById("iq_form_blank18343301").value;
}, false);

Thanks in advance!
April 4th 20 at 13:09
1 answer
April 4th 20 at 13:11
Solution
https://jsfiddle.net/2yjodm6g/14/

If input is large then it is better to use textarea
And so, brute inputof in the array and check the checked attribute
For convenience, changed name id, well it is clear I think
Thank you, my good man! Helped. Something that is necessary.)) - nellie_Johns commented on April 4th 20 at 13:14
And you can apply to the textarea without declaring it an id? That is use an id in js - nellie_Johns commented on April 4th 20 at 13:17
@nellie_Johns, Yes
The elements can be addressed by class, id, name tag, and a few of the ways
If you need latest here the getElementsByTagName()function
(note the s at the end. That is, the function will return not the element itself, and a list of items. even if it is single element)
Learn more about the methods of access elements is here https://learn.javascript.ru/searching-elements-dom - Isabell_Schmi commented on April 4th 20 at 13:20
@Isabell_Schmi, Thank You! Will experiment) - nellie_Johns commented on April 4th 20 at 13:23

Find more questions by tags JavaScriptHTML