Identifying which Radiobutton is selected through code

WRONG Syntax
if ($w(’ #radiobuttongroup1 ').selectedIndex = 3 {

must be:
if ($w(’ #radiobuttongroup1 ').selectedIndex === 3 {