All three examples you have given are using ID selectors[^]. Since each ID within the document should be unique, there's no point specifying the ID of the parent element, using the .find method, or passing the parent element with the selector. With an ID selector, jQuery uses the document.getElementById function, which is extremely efficient. All of your examples will require additional checks, which will slow your code down. Also, by specifying the parent element's ID, your script is now tied to the layout of your document. Therefore, I would prefer option 4:
PriorityOfAccessModel:
{
Id: $('#Id').val(),
FamilyId: $('#FamilyId').val(),
ChildId: $('#ChildId').val(),
Comment: $('#Comment').val(),
CreatedBy: $('#CreatedBy').val(),
CreatedOn: $('#CreatedOn').val(),
Categories: accessPriority.getCategory(),
Allocating: { Id: allocating }
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer