I have the following JS:

```
  $(document).on("click", '.like', function (e) {

      $(this).parent().html("<a href = '#' class = 'unlike'><div class = 'heart'></div></a>");
      return false;
  });

  $(document).on("click", '.unlike', function (e) {

      $(this).parent().html("<a href = '#' class = 'like'><div class = 'coal'></div></a>");
      return false;
  });

```

I also have the below html:

```
                  <div>
                   45
                    <a href = "#" class = 'unlike'>

                        <div class = "heart"></div>
                    </a>
                  </div>  

```

I am trying to get the integer 45 returned to the console using JS but am unable to do so. The 45 is in the div. I am trying to get it returned on click using parent/child or next in relation to the existing html.Any advice on how to do this?

I tried doing

```
    id = $(this).parent().text;
    console.log(id);

```

But it doesn't work.