Since the class
is added dynamically, you need to use event delegation to register the event handler
$(document).on('click', "a.tabclick", function() {
var liId = $(this).parent("li").attr("id");
alert(liId);
});
More Related Contents:
- How to get the class of a div on click [closed]
- How to get id from url?
- WordPress how to use jquery and $ sign
- What does “async: false” do in jQuery.ajax()?
- Problems inherent to jQuery $.Deferred (jQuery 1.x/2.x)
- Bind a function to Twitter Bootstrap Modal Close
- Change Active Menu Item on Page Scroll?
- Disabling submit button until all fields have values
- How to wait 5 seconds with jQuery?
- Select elements by attribute
- Fire event each time a DropDownList item is selected with jQuery
- Close Bootstrap Modal
- CSS selector case insensitive for attributes
- Reload chart data via JSON with Highcharts
- HTML Table to JSON
- What is the simplest jQuery way to have a ‘position:fixed’ (always at top) div?
- Select elements without any class [duplicate]
- find elements that are stacked under (visually) an element in jquery
- What is the difference between async:false and async:true in jquery ajax?
- JQuery data selector not updating with .data
- :nth-of-type() in jQuery / Sizzle?
- GUI-based or Web-based JSON editor that works like property explorer [closed]
- Maintain PHP Session in web app on iPhone
- Find all unchecked checkboxes in jQuery
- Validating array inputs using jquery validation plugin
- Using jQuery how do I select a range of rows?
- While variable is not defined – wait
- How to delay jquery animation?
- jQuery validate plugin : accept letters only?
- What happens when no response is received for a request? I’m seeing retries