title: How can I set the data-src on an img with pure JS?
body: <p>I would like to set a data-src attribute on an img I am creating with JS.</p>
  
  <p>Why does this not work?</p>
  
  <pre><code>const image = document.createElement('img');
  image.className = 'restaurant-img';
  image.src = '/img/1.jpg';
  image.data-src = DBHelper.imageUrlForRestaurant(restaurant);
  li.append(image);
  </code></pre>
  
  <p>IDE says: Must be lvalue</p>
  
  <p>So I cannot assign it. </p>
  
  <p>How else can I set the data-src on an img then from pure JavaScript (no jQuery); </p>