title: How to update the existing data - attribute array in this case?
body: <p>I have a div with data-attribute as </p>
  
  <pre><code>&lt;div data-stuff='["a","b","c"]'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I am fetching the existing data stuff array and update that with new value </p>
  
  <pre><code>var vendoritems = $('div').data('stuff');
  var myid = 'd';
  var value = (vendoritems.indexOf(vendoritems) &gt; -1);
  if (!value) {
      alert('doesnt contain');
  // so update the data stuff array with d value so that it contains ['a', 'b' , 'c' , 'd']
      }
  </code></pre>
  
  <p>Could you please let me know how to update that ??</p>
  
  <p>Thanks in advance ??</p>