Return ID - Function

The success function returns to jquery’s internal code, not to your response. It’s also executed after your console.log(response).

You cannot get the info via return due to ajax being asynchronous.