Hi Ben,
You can try to use other better ways to update the field for multiple selected items, which do not need any code and seems more simple than JS.
1.Bulk Edit Feature
This is ideal for those quick modifications to a smaller number of records.
(1) select records that you need modify and click edit button.

(2) A Bulk Edit form appears.

(3) update field to data that you need and click Change button, you will see following:

2.Flow.
For a number of records, you can try to use flow to achieve goal.
(1) expand Flow to create a flow.

(2) add ‘update a record’ action and set the two options field value to ‘Yes’.

(3) Click Save button.
(4) Test.
Refresh page and Select records and Expand flow to run the flow that just created.

You will see following after refresh page:

Best Regards,
Leo