Try with below code:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('.aaf').on("click", function () {
alert('jsa');
});
});
function f1() {
alert('jsa111');
$('#a1').trigger('click');
}
</script>
</head>
<body>
<p style="margin-removed 0px;" id='p1' >
<input id="btn2" name="btn2" type="button" value="Submit" onclick="f1()" />
<a href="#" class="aaf" id='a1'>xxxxxxx</a>
</p>
</body>
</html>