title: how to check if an item exist in sessionstorage?
body: <p>I am creating a web page where the user can add an item into a dropbox buy clicking a button. The sessionstorage store the partnum and quantity of the item. The dropbox will display the details (quantity would be 1)of the item selected. How do I update the quantity to 2 if the same item is selected?</p>
  
  <pre><code>        $("#btnBuy0").click(function()
          {
              $("#dropbox").append('&lt;span&gt;&lt;img class = "thumb" src="../images/21_metoyou.jpg" /&gt;' + teddy[0].desc + ", Price £"
               + teddy[0].price + ", Quantity: " + quantity + "&lt;/span&gt;&lt;br/&gt;");
              if (Modernizr.sessionstorage) 
              {  // check if the browser supports sessionStorage
                  myids.push(teddy[0].partnum + quantity); // add the current username to the myids array
                  sessionStorage["ids"]=JSON.stringify(myids); // convert it to a string and put into sessionStorage
              }   
              else 
              {
               // use cookies instead of sessionStorage
              }
              for (var item =0; item&lt;sessionStroage.length; item++)
              {
                  var key = sessionStorage.key(teddy[0].partum);
                  if (teddy[0].partnum == teddy[item].partnum)
                  {
                  var q = sesstionStorage.getItem(quantity, quantity++);
                  }
  </code></pre>