title: How to correclty assign string which contains spaces to data attribute?
body: <p>I've got stuck at one issue that, I am getting string from server side as <strong>one bottle only</strong>. I am assigning that string to data attribute like </p>
  
  <pre><code>var uom = serverSideValue // Contains ["one bottle only"]
  &lt;div class="uomClass" data-uom="+ JSON.stringify(uom) +"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>But when I inspect that element in developer tools, it is appearing like</p>
  
  <pre><code>data-uom="["one" only"]
  </code></pre>
  
  <p>If not JSON.stringify</p>
  
  <pre><code>data-uom="one" only
  </code></pre>
  
  <p>When I am trying to access uom, like below</p>
  
  <pre><code>$('.uomClass').data('uom') 
  </code></pre>
  
  <p>above line of code giving result as only <strong>one</strong> instead of <strong>one water bottle</strong> </p>
  
  <p>What I am doing wrong here. I am dynamically constructing the uom html above. Please guide me through the right way. Thank you.</p>