For example if I use this code: $('#iddoesnotexist').remove(); I will not receive an error if this id is not in the page, how to make to show an error?
By default this behaviour was chosen because otherwise jQuery would regularly throw NullReference Exceptions, but this is what I am looking for…
You can create your own jQuery extension, I suppose. I would* write it as an assertion:
And during development:
* Actually, I wouldn’t use jQuery;
document.getElementByIdalso protects you from this kind of thing;)