How to read data custom attribute from DOM in jquery
<p>I try to read the user id from "data-user-id" using jquery "data" api but I am not able to get the value of custom data attribute</p>

<pre><code>var userId = $(".invited-user").data("user-id");
</code></pre>

<p>I try above jquery code but I am not get the user id</p>

<pre><code>&lt;div id="selected-items" style="display: block;"&gt;&lt;div id="selected-items"&gt;&lt;div class="selected-item"&gt;&lt;span class="label label-info invited-user" data-user-id="51935d96db0cad4b290004c5"&gt;
    &lt;span class="invited-user-name"&gt;
        Kumaran
    &lt;/span&gt;
    &lt;button class="btn btn-info remove-btn"&gt;x&lt;/button&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
</code></pre>

<p>Please suggestion a jquery api to read the custom data attribute. </p>
