I have got a big "click" function in jQuery with a lot of code like this:
$(".Line1").click(function () {
...
}
I am creating new buttons dynamically which means that the "click" function doesn't trigger. Now I know that I could add a function like this in order to get it working:
$("#myButton").on('click', function () {
...
});
The problem is that my code in the normal click function is too long so I can't just copy and paste it into the new function, it would be way too confusing.
Is there a way where I can link it back up with the old click function? Or can you think of anything else?