title: How to write a function that knows a button has been clicked that executes something if another button is enabled?
body: <p>I have three buttons and the last two are disabled and the first is enabled. After clicking the stop button, the first and last then become disabled and the middle button becomes enabled. At each click of the stop button a message pops up. I want the stop button to know that it's on the middle button and that its enabled so it has its unique message pop up.</p>
  
  <p>I have tried </p>
  
  <pre><code>//html
  &lt;div class="Input" id="Input"&gt;
          &lt;div class="onOff"&gt;
              &lt;button id="on" class="on" onclick="activate(); 
  gillespie();"&gt;Begin Simulation&lt;/button&gt;
              &lt;button id="stop" class="off" onclick="disableA(); 
  stopDesc()"&gt;Stop Simulation&lt;/button&gt;
          &lt;/div&gt;
  &lt;div class="mRNAbutton"&gt;
              &lt;button id = "rnaLow" class="mRNAlow" onclick="fmRNAlow()"&gt;[Low 
  mRNA]&lt;/button&gt;
              &lt;button id = "rnaMedium" class="mRNAmed" onclick="fmRNAmed()"&gt; 
  [Medium mRNA]&lt;/button&gt;
              &lt;button id = "rnaHigh" class="mRNAhigh" onclick="fmRNAhigh()"&gt; 
  [High mRNA]&lt;/button&gt;
          &lt;/div&gt;
  //Javascript
  function ifEnabled()
  {
  var ifEnab = document.getElementById('rnaMedium');
  
  if(ifEnab.enabled &amp;&amp;  document.getElementById('stop').clicked == true){
  
  //random code
  }
  </code></pre>
  
  <p>The expected result is the stop button being able to give me different pop-up messages based on which button is enabled at that time.</p>