I have two buttons VIEW JOB and APPLY JOB . When I click VIEW JOB a modal window appear and contain a button APPLY. When I click the APPLY button in modal the click event of APPLY JOB will called.
<button id="view_job">VIEW JOB</button>
<button id="apply_job">APPLY JOB</button>
button in modal window
<button id="apply_job2">APPLY</button>
$("#apply_job").click(function(){
var jobid=$(this).parent().find(".job").val();
//manage parameter from popup button click
//common code..
});
$("#apply_job2").click(function(){
$(".jobpanel").parent().find("#apply_job").click(); //here need to pass parameter
});
So when I click both apply job button(in page and in popup) same action is occured (action of apply_job button). But I have to distinguish that from where the action occured. That is, if from popup, I need to do some extra things..So can I pass some parameteres to the button click from popup.
<>and give us a minimal reproducible example so we can tell you how$("#apply_job2").click(function(){ someParameter="someValue"; $(".jobpanel").parent().find("#apply_job").click(); });and have$("#apply_job").click(function(){ doSomething(someParameter)