Toggle text value is changing for single button, when I am using the same id for multiple toggle button its not changing.
Here toggle buttone am or pm.
here my javascript code i used
$(document).ready(function(){
$('#myToggle').on('click', function () {
var text=$('#myToggle').text();
if(text === "am"){
$(this).html('pm');
} else{
$(this).text('am');
}
});
});
here is my html line used for toggle button:
<button type="button" data-toggle="collapse" href= "#" id="myToggle" class="btn btn-secondary">am</button>
And it says id value myToggle must be unique.
