If using the above function's we will not get the alert of displayCustinfo() as the function name is different(Capital I, small i). If we change them then we will get the alert messages.
Here is the code I have tried. If any one find better code please provide here.
<button onclick='setValue("James","Bond",30)'>Submit</button>
script:
function setValue(fname,lname,age){
setCustInfo(fname);
displayCustinfo(lname);
}
function setCustInfo(name){
alert("The name is set as :" + name);
}
function displayCustinfo(name){
alert("Name is displayed as :" + name);
}