title: How to manipulate an custom attribute javascript
body: <p>I'm struggling with this script where I need to &quot;select&quot; an attribute of a HTML tag.</p>
  <p>Its an application that when I click on button would start this countdown but</p>
  <p>I'm using and customized countdown that I found. And it has this attribute named &quot;data-date&quot;</p>
  <pre><code>&lt;div data-date=&quot;&lt;?php echo date('Y/m/d H:i:s', $today); ?&gt;&quot; id=&quot;count-down&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>I know that I would have problems with <code>&lt;?php echo date('Y/m/d H:i:s', $today); ?&gt;</code></p>
  <p>but that's okay I think I did it solve it to change to javascript.</p>
  <p>So this is how my script got</p>
  <pre><code>                var oldDateObj = new Date();
                  var time = new Date();
                  time.setTime(oldDateObj.getTime() + (&lt;?=$time?&gt; * 1000)); //adding time to the current time
  
                  //How it should get
  
                  //&lt;h2&gt;Countdown&lt;/h2&gt;
                  //&lt;div data-date=&quot;&lt;?php //echo date('Y/m/d H:i:s', $today); ?&gt;&quot; id=&quot;count-down&quot;&gt;&lt;/div&gt;
  
                  document.getElementById(&quot;coluna1&quot;).innerHTML = &quot;&quot;;
  
                  let temp = document.createElement('h2');
                  temp.innerHTML = 'Temporizador';
  
  
                  let div1 = document.createElement('div');
                  div1.data-date = time;                         //where the error occurs 
                  div1.id = &quot;count-down&quot;;
  
  
                  document.getElementById(&quot;coluna1&quot;).appendChild(temp);
                  document.getElementById(&quot;coluna1&quot;).appendChild(div1);
  </code></pre>
  <p>The error is an Uncaught syntax error: Invalid left-hand side on assignment</p>
  <p>So with someone has any idea to help me out, share it please :)</p>