LOL, sorry, I normally comment my examples...
The function takes two arguments, the id of a
HTML element and the name of the class that this element will receive.
Within the function, the first line is storing a reference to the
html element with the next line setting the className property to the given class.
The
HTML code contains a ternary function call esentially, when the radio button is clicked, it checks whether that click has resulted in the radio button being selected. If it has, it runs the function giving it an element id and a class name. If it turns out that this click has resulted in the radio not being checked any longer, nothing happens.
Hope that makes it a bit clearer.