Delete selected SharePoint list items through JavaScript

To delete a list item, call the deleteObject() function on the object. The following example uses the getItemById(id) function to return the second item from the list, and then deletes the item.

SharePoint Foundation 2010 maintains the integer IDs of items within collections, even if they have been deleted. So, for example, the second item in a list might not have 2 as its identifier. A ServerException is returned if the deleteObject() function is called for an item that does not exist.

Code below:

Leave a Reply

Your email address will not be published. Required fields are marked *