So I'm new to JavaScript. I'm trying to create a simple code that'll allow the person to choose `binary`, `hex`, or `oct` and convert a decimal number to the chosen radio button. Now i'm not worried about the conversion at this point, I'm just trying to get the code to run a function after I hit submit. For example, if radio button binary is selected, once the submit button is clicked, on the page it should say "binary selected." 

I'm really lost as to how to get this to work and not sure where to look. I keep changing my code i got it to work when you select the button it generate "object selected", but i want it to generate only after the submit button is pressed. Unsure if i have to code the submit button or the form tag. My current, non working code is as follows:

```html
<!DOCTYPE html>
<html>
 <head>
  <script>

  function convertit()
  {

   var conversion = document.getElementsByName('convert');

   if (conversion[0].checked == true) 
   {
    document.getElementById('test').innerHTML = "Binary Checked";
   }

   else if (conversion[1].checked == true)  
   {
    document.getElementById('test').innerHTML = " Hex Checked";
   }

   else if (conversion[2].checked == true)  
   {
    document.getElementById('test').innerHTML = "Oct Checked";
   }

    else
   {
    alert("Empty");
   }
   return true;
  }

  </script>
 </head>

 <body>

  <p id="test"> </p>

  <form onsubmit="return convertit();">
   <input type="radio" value="binary" name="convert" id="binarybut"  >
     Binary 
   </input>

   <input type="radio" value="binary" name="convert" id="hexbut" >
     Hex
   </input>

   <input type="radio" value="hex" name="convert" id="octbut"> 
    Oct
   </input>

   <input type="submit" value="Convert Number" > 

  </form>

</body>
</html>
```