How to handle onclick events from multiple dynamically created anchor tags using jquery/javascript?
===

I have multiple dynamically created anchor tags that work as buttons. When any of these buttons are clicked, I want to call a single javascript function that sits in another file, which will do the rest of the fun work. My problem is that I cannot properly call the function via the 'onclick' event, so I am trying to find a way around it but it's just not so simple for me. 

I have tried many different ways so I understand a few limitations with this approach:

Standard HTML anchor with Javascript:

    1. <a href="#" onclick="doSomething(parameter1, parameter2, ...);">Button</a>
 
This is not going to help because there are synchronization issues and I have found that href will be chosen above on click almost always I have found. I actually would love this way to work, if you know any workarounds here then please let me know.

Binding via JQuery:

    2. $(document).ready(function() {
            $("#button_id").click(function() {
                doSomething(parameter1, parameter2, ...);
            });
        });

My issue with binding is that when the page is loaded, I have a function that gets the data from the database and displays it in a list. Each list element has a button, which 'on click' will call a javascript function, passing it parameters according to whatever data I need to give it from the list element, and it then will do something.

I understand that in order for Binding to work well, each button should have its own ID so that its easy to associate them with the Binding method. However, I am not sure how to tell the the .click function how many ID's I have, nor how to give it these parameters (unless I capture them via button ID by calling other JS functions).

Any suggestions/ideas are highly appreciated!