function submitPollAnswer(){const params=new URLSearchParams(window.location.search);const parameterValue=params.get('answer');if(!parameterValue){return;} const answerOption=document.getElementById('poll-answer-'+parameterValue);if(!answerOption){return;} const pollElement=document.querySelector('[id^="polls-"]');if(!pollElement){console.log("No poll elements found with id starting with 'polls-'");return;} const pollId=pollElement.id.split('-')[1];answerOption.checked=true;const voteButton=document.querySelector('[data-poll-action="vote"][data-poll-id="'+pollId+'"]');if(voteButton){voteButton.click();}else{console.log('No vote button found for poll '+pollId);}} document.addEventListener('DOMContentLoaded',submitPollAnswer);