I need to obtain the value of a radio button using javascript
I have a radio group called selection
Although Matt's solution works perfectly fine and solves your immediate problem, I would also recommend that you start looking into a JavaScript library, like JQuery, if you will be frequently querying the DOM.
With JQuery, your solution is a one-liner:
var selectedValue = $("input[name=selection]:checked").val();