title: limit click button in html
body: <p>I am trying to limit a button that can be clicked only 5 times to add radio button. After 5 times adding radio button, it will be disabled. What is the javascript code for this matter? I only able to disable it once after it is clicked. Below is the code</p>
  
  <p>html</p>
  
  <pre><code>&lt;input type ='button' id="id" onClick="a();"&gt;
          &lt;div id='a'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>function a(){
      document.getElementById('a').innerHTML += "&lt;input type='radio'&gt;";
      document.getElementById("id").disabled=true;
  }
  </code></pre>