I have tried to create sample code to insert items in SharePoint list with your code.
Please check the myFunction
function in javascript to add item.
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<script src="js/index.js"></script>
<script type="text/javascript">
document.title = "La salute della tiroide";
document.getElementById('welcome').innerHTML='Benvenuto '+username[1]+',</br> se vuoi partecipare a uno dei due eventi, </br> scegli la data e registra la tua partecipazione:';
document.getElementById('welcome').style.cssText="font-size:11px; margin-left: 30px;";
function myFunction() {
var CheckedStatus;
//Retrieve the chkConfirm and check if it has some text.
var chkConfirm = document.getElementById("chkConfirm");
if (chkConfirm.checked) {
CheckedStatus = true;
}
else
{
CheckedStatus = true;
}
//Retrieve the clientContext
var clientContext = SP.ClientContext.get_current();
//Retrieve the current website
var webSite = clientContext.get_web();
//Retrieve the lists
var lists = webSite.get_lists();
//Get the Cars List
var carsList = lists.getByTitle("Your List Name Here");
//Create new IteamCreationInformation
var itemCreationInfo = new SP.ListItemCreationInformation();
//the addItem takes the itemCreationInformation object
//and returns the listItem
var listItem = carsList.addItem(itemCreationInfo);
//Set the title of the list Item
//to the value in the chkConfirm
listItem.set_item("Your column with yes/no option", CheckedStatus);
////Add the user in another column by same method listItem.set_item
////Add other fields in different columns by same method listItem.set_item
//Call Update the listItem
listItem.update();
//Finally execute the operation
//pass to it a 2 callBack methods OnSucceed and OnFailure
clientContext.executeQueryAsync(
Function.createDelegate(this,this.Succeeded)
,Function.createDelegate(this,this.Failed));
}
function Succeeded() {
alert("Succeeded");
}
function Failed(sender,args) {
alert("fail");
}
</script>
<div class="container">
<div id="welcome" style="color: #fff;" ></div>
<div>
<input type="checkbox" id="chkConfirm">
<p>Plase check the box to confirm presence</p>
</div>
<div>
<img src="img/invia_button-158x36.png" width="158" height="36" border="0" id="submit" onclick="myFunction()"/></a>
</div>
</div>
To add current user please check below given reference URL.
Adding the current user to a list item by using SharePoint 2013 CSOM
To know all CRUD operations using JavaScript for SharePoint, Kindly refer below link.
How to: Create, Update, and Delete List Items Using JavaScript
NOTE :- You should atleast try to search on the internet first than after you can ask question here for your queries.