Since you do not have an element named == CountAnswer . You need to specify a specific name, for example:
$("[name='CountAnswer[1]']").val();
Alternatively, you can use the โStart withโ ( ^ ) wildcard to match all elements whose name begins with CountAnswer :
$("[name^='CountAnswer']").val();
This, of course, only returns the value of the first element in the matched set, since this is val() behavior.
source share