Creating round checkboxes with tick marks dynamically and appending them to id="demo"
on the click of two buttons that invoke the get(data)
method is my current goal.
The issue arises when both buttons are clicked simultaneously, as the checkboxes do not get checked and it leads to multiple calls to the getdata(idD + '_chckBox')
method, which can be observed in the console.log.
Despite using
e.preventDefault(); e.stopPropagation();
, the problem persists.
Why is the getdata(idD + '_chckBox')
method called multiple times and the round checkbox remains unchecked?
I am attempting to toggle the checkbox and display the tick mark. Any suggestions for a better approach are welcome.
What is the most efficient way to bind the onclick
and onscroll
methods in dynamic HTML elements within a loop so that an object can be passed as a parameter to the invoked method onclick?
index.html
var data0 = [{
"title": "a"
},
{
"title": "b"
},
{
"title": "c"
............