title: ES6: how to update a property inside a Class, using getters and methods
body: <p>I want a method to update the value of a property, defined through a getter. 
  The property gets the value of an HTML data-attribute, and the method mut just increment it by 1 and update it in the HTML. 
  The method is called when a button is clicked. Than the next time the button gets clicked again, I suppose the getter to redefine the value of the property, getting the new value of the data-attribute. But it doesn't occur.</p>
  
  <p>The environment allows me to use jQuery, because the 'element' which is the main argument of the constructor, is a jQuery object representing the HTML target element of the component.</p>
  
  <p>This is the code:</p>
  
  <pre><code>import {Components} from 'MyCustomLibrary';
  
  export default class Calendar extends Components{
  
     get CurrentMonth(){
        return this.element.data('calendar-currentmonth');
     }
  
     onClickHandler(){
        this.getNewCalendar(this.CurrentMonth);
     }
  
     getNewCalendar(month){
       /****
       /* jQuery substituted with Vanilla for suggestion in the comments
       $('[data-calendar-currentmonth]').data('calendar-currentmonth',month+1);
       ****/
  
  
       let dataAttributes = document.querySelectorAll('[data-calendar-currentmonth]');//.data('calendar-currentmonth',month+1);
       dataAttributes.forEach(function(e){
           e.setAttribute('data-calendar-currentmonth',parseInt(month)+1);
       });
     }
  
     constructor(element){
         super(element) //element is the html target of component, and it's a jQuery object
  
         this.element.on('click', this.onClickHandler.bind(this));
     }
  
  }
  </code></pre>
  
  <p>In the html I have my button which is an anchor tag with 'data-calendar-currentmonth=2' attribute. 
  Initally it is set to 2, than the first time I click, the function updates the attribute, I can see "3" in my html DOM through console.</p>
  
  <p>But than when I click again, the value of CurrentMonth is again "2", and more, the html doesn't update anymore (maybe just because the property value doesn't update and than 2+1 is always 3).</p>
  
  <p>Isn't getter supposed to be executed every time the property it defines is called? So why does it doesn't get the new value inside the HTML When it is called the second time?</p>