title: how to access javascript variables inside php script?
body: <p>What should I do if I want to save a javascript variable value, say <code>var a</code>, inside a php script variable without using post/get method or ajax?</p>
  
  <pre><code> &lt;script&gt;
    var count=3;
     $("#add_driver").click(function () { 
    $( "#add_driver_section").replaceWith( "&lt;div class='wrap-input100 validate- 
   input bg1 rs1-wrap-input100' &gt; &lt;span class='label-input100'&gt;Gender&lt;/span&gt; 
   &lt;div class='contact100-form-radio m-t-15'&gt; &lt;input class='input-radio100' 
    id='male-radio"+ count +"' type='radio' name='type-product"+ count +"' 
      value='male' checked='checked' &gt; &lt;label class='label-radio100' for='male- 
        radio"+ count +"'&gt; Male &lt;/label&gt;&lt;/div&gt;&lt;div class='contact100-form- 
        radio'&gt; &lt;input class='input-radio100' id='female-radio"+ count +"' 
        type='radio' name='type-product"+ count +"'  value='female' &gt; &lt;label 
        class='label-radio100' for='female-radio"+ count +"' &gt; Female &lt;/label&gt; 
         &lt;/div&gt;&lt;/div&gt;");  
    count++;}
     );
  &lt;/script&gt;
  </code></pre>
  
  <p>i have edited my question to give you guys a little more perspective as to what i want to acheive. Here i first want to check if <code>type-product"+ count +</code> is set or not. if it is set then i want the radio button's <code>selected</code> attribute to have the value selected. </p>