Question: I have this code

```
<div></div>
<form>
<input type="text" name="abc">
<input type="submit" value="send">
</form>

$('form').on('submit', function(){
   $.post('process.php', $(this).serialize(), function(data) {
    $('div').html(data);
   });
   return false;
});

```

Everything works but after submit value that I filled into input is gone and it's empty..Where can be problem?

Answer: 
You can create a static array and store it on your constructor function:

```
MyClass.allInstances = [];
MyClass.allInstances.push(this);

```

However, you need some way to figure out when to remove instances from this array, or you'll leak memory.
In Chrome 62+ you can use [`queryObjects` from the console API](https://developers.google.com/web/tools/chrome-devtools/console/utilities#queryObjects) - which will **not work** in native JavaScript code but in the console so it's **great for debugging**.

```
class TestClass {};
const x = new TestClass();
const y = new TestClass();
const z = new TestClass();
queryObjects(TestClass)

```