mardi 4 août 2020

Checking a Checkbox through JS in browser

I'm looking to set multiple values and checkboxes on a webpage using JS.

I'm able to do values using

document.querySelector('input[name="date"]').value = '1/1/2000';
document.querySelector('form').submit();

...that's simple enough. There are multiple checkboxes that may or may not need to be checked. What is the process to check a box through the console? Here is a sample of one of them when it is checked:

input id="FormView1_cb_EXAMPLE" type="checkbox"

name="FormView1$cb_EXAMPLE" checked="checked"




Aucun commentaire:

Enregistrer un commentaire