Adding form element to output

Poppler takes care of almost everything, I simply added the form tags at the end of every page.
In a way or another, with or without a CSS selector (even the :checked one) I need these few lines of js. Thing is these radio buttons are merely <div> elements, so I need JS to add and remove this specific class, the one who will display the actual "checked" symbol.