Added support for $.confirm instead of relying on an element