How to get multiple checkbox value on button click?


#1

<td><p><input  class="checkbox"  type="checkbox" value="Cars.id"> </p> </td>

this is list of cars id with checkbox.

<button (click)="duplicate()" ></button>

on this button click i want to get value of all cars in my .ts file. here is the function in .ts

duplicate(){
    var checkedValue = document.querySelector('.messageCheckbox:checked');
}

how to get value of all checked item in one click?