What is the best way to call two functions upon a single click event?
There will be multiple elements requiring this script, so the script must act only upon the element
$(function() {
$('a').click(function() {
func1();
func2();
});
});
jQuery will handle that for you quite nicely, see example:
$('div').click(function(){
alert($(this).text()+' clicked');
})
.click(function(){
$(this).css({'color':'#ff0000'});
});
<div>Button 1</div>
<div>Button 2</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Here's a jsFiddle example: http://www.jsfiddle.net/pcASq/