In my application, data is retrieved from database and then checkboxes are created dynamically. Following is the code
When the checkbox is checked/unchecked, it should call another function named "checkboxClicked" in the above code
Following the function code
Thus, if 4 checkboxes are created , their name would be myCheckbox0,myCheckbox1,myCheckbox2,myCheckbox3 respectively. This is implemented in the 1st code posted
Now, when the 2nd checkbox with id myCheckbox1 is checked , the checkboxClicked function is called. This function contains the parameter, which is passed as a var i. The function runs and It alerts the id, i.e myCheckbox1. However, it alert false.
This happens with all checkboxes. I need that if the checkbox is checked, it should alert true, and if unchecked, it should alert false.
Also, if you are still using alerts for debugging, you need to get familiar with the modern debugging consoles built into every modern browser. Otherwise it's like trying to fight a laser remote with the blast shield down -- and you can't use The Force.
That's likely a matter of the CSS and the structure. The Chrome debugging console, in Element view, also has excellent tools for inspecting the CSS so you can find out exactly what was applied and where.
Select an element in Element view, and the right pane will show you the computed CSS and where it came from. You can use that to debug any style issues.