add exists method to jquery

When checking the existence of an element in the dom we currently have to check like
```js
if (document.getElementByID('myid')) {
  // do sth.
}
if ($('#myid').length) {
  // do sth.
}
```
This PR introduces `jQuery.fn.exists()` allowing us to write a more self-explaining
```js
if ($('#myid').exists()) {
  // do sth.
}
```

@DeepDiver1975 @karlitschek like? :+1: !

PS: also uses `jQuery` instead of `$` for the selectRange method.