title: How to send a data from one html page to another using javascript
body: <p>Sorry If my question is duplicate, I couldn't find anything similar.
  I'm trying to send my values from one HTML to another HTML using local storage, my HTML1 page contains grocery items when I select and click next button the items are stored in a final variable it has to be sent to another HTML2 page i.e. the billing session</p>
  
  <pre><code>//Htmlpage1 want to send the radio button details to html2page
          &lt;form class="mt-5"&gt; 
              &lt;div class="row mt-5"&gt;
                  &lt;div class="col-sm-4"&gt;
                    &lt;bold&gt;&lt;p&gt;Black Rice&lt;/p&gt;&lt;/bold&gt;
                      &lt;input type="radio" name='item1' value='1 KG @ Rs.199' data-id="blackrice1kg" /&gt;1 KG @ Rs.199&lt;br&gt;
                      &lt;input type="radio" name='item1' value='2 KG @ Rs.390' data-id="blackrice2kg" /&gt;2 KG @ Rs.390&lt;br&gt;
                      &lt;input type="radio" name='item1' value='3 KG @ Rs.550' data-id="blackrice3kg" /&gt;3 KG @ Rs.550&lt;br&gt;
                  &lt;/div&gt;
                  &lt;div class="col-sm-4"&gt;
                          &lt;img src="img/Taruproduct.png" alt=""&gt;
                      &lt;bold&gt;&lt;p&gt;JaggeryPowder&lt;/p&gt;&lt;/bold&gt;
                      &lt;input type="radio" name='item1' value='100 Sachets @ Rs.199' data-id="JaggeryPowder1kg" /&gt;100 Sachets @ Rs.199&lt;br&gt;
                      &lt;input type="radio" name='item1' value='200 Sachets @ Rs.390' data-id="JaggeryPowder2kg" /&gt;200 Sachets @ Rs.390&lt;br&gt;
                      &lt;input type="radio" name='item1' value='300 Sachets @ Rs.550' data-id="JaggeryPowder3kg" /&gt;300 Sachets @ Rs.550&lt;br&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <pre><code> //html2 page 
      &lt;div class="container text-center"&gt;
             &lt;h5 class="display-2 mt-5 mb-5"&gt;Subscription Box&lt;/h5&gt;  
             &lt;form&gt;
             &lt;div class="form-group"&gt;
             &lt;p&gt;Black Rice &lt;input type="text" id="blackriceqty"  class="form- 
               control"&gt;&lt;/p&gt;   
             &lt;form&gt;     
      &lt;/div&gt;
  </code></pre>
  
  <pre><code>//javascript code
   $(document).ready(function () {
     $("input[type='radio']").click(function(){
        var final = $("input[name='item1']:checked").val();
        $(".result").val(final);
        localStorage.setItem(textValue,final);
        document.getElementById("blackriceqty").innerHTML=localStorage.getItem(textValue);
       });
  </code></pre>