Resusing jQuery functions
<p>I'm working on a web project which is done using php and jQuery. All the jQuery functions are being stored in one .js file. All the modules of the project has similar functionality.
<br/>My problem is when a certain function is used for 2 or 3 times it stops working for other instances.<br/>
For example, to retrieve the clicked element's name first I was using</p>

<pre><code>$('#articleCPanel #editorPanelActions input').click(function () {
    var actionName= ($(this).attr('name');
 });
</code></pre>

<p>but then after couple of modules this was no longer working. I had to use the below code instead</p>

<pre><code>$('#videoCPanel #editVideo fieldset input').click(function(event) {
    var actionName = $(event.target).attr('name');
});
</code></pre>

<p><br/>I would like to know is there any explanation for this?
<br/>I appreciate any help
<br/>Thanks in advance :)</p>
