Creating new SQL Server record from script file within JavaScript in HTML

I'm trying to write a button-click event in JavaScript.
The purpose of the button would be to use the values entered in Input controls to build and save a new record in my SQL Server table.
My first idea is to use an "INSERT INTO" statement to correlate the field values from the form with corresponding fields within the new record, like the following:
INSERT INTO table_name (field1, field2, field3, ...)
VALUES(value1, value2, value3, ...);

Any hints as to how far "out in left field" I am, or even answers to the best way to proceed would be greatly appreciated.

I would not recommend to use JavaScript to store data to the SQL Server. It is all client-side and you should not do that. You should take a look at PHP (MySQL) or ASP.NET Core Blazor (MS SQL Server).

For MS SQL SERVER I would suggest to start here:

How To Learn Web Development In 2023 (youtube.com)

Choose an ASP.NET Core UI | Microsoft Learn