Please enable JavaScript
soap/ajax/54.0/connection.js library can be used to create records using JavaScript in Salesforce. There is no need to use Apex. Blog Post: https://www.infallibletechie.com/2022/06/record-creation-using-javascript-in.html