« XUL Reference
itemCount
Type: integer
Read only property holding the number of child items.

Example

var bucket = document.getElementById("attachmentBucket");
if(bucket.itemCount == 0) {
  dump("\n\n No attachments \n\n");
} else {
  dump("\n\n Attachment Exists \n\n");
}