vendredi 7 septembre 2018

Trying to tick only checkboxes that contain certain selector in Javascript/jQuery on third-party website

I am on a website and I am trying to find attributes I can use to select or deselect the checkboxes (by certain criteria)

For example

Mike [x] John [ ]

I want to select the Mike box only using the console on Chrome.

My code is

Array.from(document.querySelectorAll('input:checkbox[name=Mike]").prop("checked",true)')) .filter(input => input.value === 'on') .forEach(input => input.click())

Would anybody be able to help?




Aucun commentaire:

Enregistrer un commentaire