I created a form using HTML and now I need to show text which user has selected using a checkbox in the text field I tried and it works but it shows only one selected items
can anyone solve this issue so then I can print multiple names in textfield
function myFun(extras) {
document.getElementById("check").value = extras;
}
<fieldset>
<legend>Extras</legend>
<p><label class="choice">
<input type="checkbox" name="extras" value="baby"onclick="myFun(this.value)" >
Baby Seat
</label></p>
<p><label class="choice">
<input type="checkbox" name="extras" value="wheelchair"onclick="myFun(this.value)" >
Wheelchair Access
</label></p>
<p><label class="choice"> <input type="checkbox" onclick="myFun(this.value)" name="extras" value="tip">
Stock Tip
</label></p>
<input type="text" id="check">
</fieldset>
strong text