It is used to update the collection with a set of items in a model. If any new model is found, the items will be added to that model.
models − It includes an instance of the collection along with the values to be set in the collection.
options − It includes parameters such as id, name, etc., to set the values in the collection.
Let us carry out the following steps to see how the above code works −
Save the above code in the set.htm file.
Open this HTML file in a browser.