dynamic radio buttons as navigation not working until page refresh

dynamic radio buttons as navigation not working until page refresh

Hello

I have a bunch of radio buttons, in a popup, that use the below to show and hide related divs, thus allowing them to be used as a form of navigation. 

  1.    $(":radio[name='radio']").on("change", function () {
  2.         var test = $(this).val();
  3.         $(".radio").hide();
  4.         $("#" + test).show();
  5.     });
This works find when I load the page, the code in contained within the 
  1. $('#gameIndex').on('pageshow', function (event, ui) {
However I also want to be able to dynanically add new radio buttons - the divs the button point to already exist on the page.
I'm adding the buttons with:

  1. $("#buttons").append('button code')
and then refreshing the div that contians the buttons with:

  1. $("#radiodiv").trigger("create");
When I then trigger the popup with tte buttons they all appear as expected and are themed correctly. however when the buttons are clicked on they do nothing, they don't even seems to fire any kind of event. If I refesh the page they all start to work as expected. 

Can any one please help me with this?