For users coming to this question after 2011, there is a new proper way to do this:
$(document).on('click', '.btn_test', function() { alert('test'); });
This is as of jQuery 1.7.
For more information, see Direct and delegated events
More Related Contents:
- Disable a part of JavaScript code [closed]
- How to get children id when I click the parent?
- $(document).click() not working correctly on iPhone. jquery [duplicate]
- onClick not working on mobile (touch)
- Get the contents of a table row with a button click
- Why is this jQuery click function not working?
- Attaching click event to a JQuery object not yet added to the DOM [duplicate]
- How to completely DISABLE any MOUSE CLICK
- JavaScript: Invoking click-event of an anchor tag from javascript
- Change CSS properties on click
- Prevent onclick action with jQuery
- jQuery – How can I temporarily disable the onclick event listener after the event has been fired?
- Simulating a click in jQuery/JavaScript on a link
- jquery use of bind vs on click
- Function not calling within an onclick event
- How to get numeric value from a prompt box? [duplicate]
- jQuery has deprecated synchronous XMLHTTPRequest
- Send POST data on redirect with JavaScript/jQuery? [duplicate]
- How to set value of input text using jQuery
- Triggering onclick event using middle click
- How can I get selector from jQuery object
- jQuery returning “parsererror” for ajax request
- Reverse Scrolling
- How do I get an element to scroll into view, using jQuery?
- Is there a full working example for a jqGrid ColumnChooser? [closed]
- How to open the select input using jquery
- HTML5 callbacks?
- preload with percentage – javascript/jquery
- Gaussian Blur onHover Using jQuery
- canvas- Cropping images in different shapes