I have this simple code below. There are two radio buttons. If you click on one of them, it will execute a code that will print into "object\_type". In my real program the click runs many lines of code and loads a map. If the radio button was previously already selected and I click it again, I do not want the code to run again. How can I accomplish that? 

```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#r1,#r2").on("click", function(){
      var radiovalue = $('input[name=tt1]:checked').val();
      $('#object_type').html(radiovalue);
   });
});
</script>
<div class='mi' id='r1'><input type="radio" name="tt1" value="1" id="radio_1">One</div>
<div class='mi' id='r2'><input type="radio" name="tt1" value="2" id="radio_2">Two</div>
<div id="object_type"></div>​

```