title: Onclick event for li with javascript in asp.net mvc
body: <pre><code>&lt;ul&gt;
  @foreach (var item in Model.Users.Where(s =&gt; s.DepartmentId == 3))
  {
  &lt;li&gt;
  @Ajax.ActionLink(item.UserName, "Index", new { item.Id }, new AjaxOptions() { HttpMethod = "Get" });
  &lt;/li&gt;
  }
  &lt;/ul&gt;
  </code></pre>
  
  <p>How can ı get item.Id if i onclick item.username with javascript ?</p>
  
  <p>I thought give to attribute to "li onclick".but i dont know there is better solution here or not ?</p>