Skip to content

Instantly share code, notes, and snippets.

@opabravo
Last active February 20, 2023 03:50
Show Gist options
  • Save opabravo/c234e483daf4e41f2da1e0a61f9bd70a to your computer and use it in GitHub Desktop.
Save opabravo/c234e483daf4e41f2da1e0a61f9bd70a to your computer and use it in GitHub Desktop.
問卷評量自動打勾(吼好煩)
// Custom form embeded in iframe
var frame = document.getElementsByTagName('frame')[2]
var rd_btns = frame.contentDocument.querySelectorAll('input[type="radio"]')
for(var i=0;i<rd_btns.length;i++){
if(rd_btns[i].value=="C")
rd_btns[i].checked=true;
}
frame.contentDocument.GcpaForm.submit()
// Google Form
check_boxes = document.querySelectorAll('[role="checkbox"]')
check_boxes.forEach(function(e){e.click()})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment