- I want to count the number of checkboxes checked when a button is pressed
Does the initial bool value determine whether it can be obtained or not? ?
Cannot read property when trying to get witherror. When the initial value is true and the check box is set to false, it can be obtained with
document.getelementbyIdwhen getting the state of a checkbox whose initial value is false I get a 'checked' of null
docoument .... How can I get a checkbox with an initial value of false?
Is there any way to write a value when the initial value of the check box is false (or get the value regardless of the initial value)? ? ?
// If the initial value is true, it can be obtained as follows, but if it is false, it cannot be obtained. document.getElementById ('row_0'). checked
Answer # 1
Is it possible or not to be determined by the initial bool value? ?
That's not true. Make sure that the ID is in the
documentproperly (If it is generated by Vue.js, it may be a failure to get it at the timing before generation).
Answer # 2
If you get an error, read the error message.
Cannot read property 'checked' of null
I can't read null 'checked'.
That means your code is not a second checkbox
Because we are trying to read checked against null.
You can see it by running
document.getElementById ('row_0') document.getElementById ('row_1')
There's just no
If the initial value is true, you can get it below, but if it's false, you can't get it
That's not the case.
If you get an error, don't ask immediately, but if this is the case, try the following first.
Try setting the initial value of row_0 to false
Try setting the initial value of row_1 to true
Answer # 3
Cannot read property 'checked' of null error when trying to get with document.getelementbyId when getting the state of the check box whose initial value is false (the state when the button is pressed is irrelevant) The When the initial value is true and the check box is set to false, it can be obtained with document ... How can I get a checkbox with an initial value of false?
Put a reference link.
An accurate answer is not possible without looking at the code.
Answer # 4
For now, just the base
There is no particular problem
If it is not a source problem, it may be a problem with the operating environment such as the OS or browser
- php - i want to check the array and put its value in the database if there are no duplicates
- php - i want to recover a wordpress site infected with malware