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: 
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)

```
You'll need to store a list of instances yourself:

```
function someClass(param) {

  // add to all
  if (this.constructor.all === undefined) {
    this.constructor.all = [this];
  } else {
    this.constructor.all.push(this);
  }

  // set param
  this.logParam = function() { console.log(param); };
}

var instance1 = new someClass(1);
var instance2 = new someClass(2);

for (var i = 0; i < someClass.all.length; i++) {
  someClass.all[i].logParam();
}

```

If memory leaks are a concern then you can create a method for deleting instances when you are done with them:

```
function someClass(param) {

  ...

  this.destroy = function() {
    var all = this.constructor.all;
    if (all.indexOf(this) !== -1) {
      all.splice(all.indexOf(this), 1);
    }
    delete this;
  }
}

```