title: getting data from data attribute
body: <p>I set a data attribute for a user on a link like this</p>
  
  <pre><code>  &lt;input type="button" class="btn" data-user={"user": "&lt;%= @user.name %&gt;"}  value="Start" id="game"&gt;
  </code></pre>
  
  <p>In the javascript function that listens for the click event, I did a <code>console.log(e.target)</code> and it printed the whole thing to the console.</p>
  
  <pre><code>&lt;input type="button" class="btn" data-user={"user": "&lt;%= @user.name %&gt;"}  value="Start" id="game"&gt;
  </code></pre>
  
  <p>If I do <code>console.log(e)</code> i.e. with no e.target, it logs the jquery event, but the data attribute is undefined</p>
  
  <pre><code>data: undefined
  </code></pre>
  
  <p>I'm trying to pull the username from the data attribute but don't know how to get it from this</p>
  
  <pre><code>&lt;input type="button" class="btn" data-user={"user": "&lt;%= @user.name %&gt;"}  value="Start" id="game"&gt;
  </code></pre>
  
  <p>and I don't know why data is undefined when I log just the event. </p>
  
  <p>I'd be very grateful if you can assist me with this. Thanks in advance. </p>