4 ms·What if $(el).length === 0?by zabraxias 13y agoWhat if $(el).length === 0?exizt88 13y agoThis check is required in both cases. el.outerHTML assumes that el is not NULL (which it could be as a result of getElementById, for example).