title: jstree rename all nodes from a class
body: <p>Good morning,</p>
  
  <p>I'm using a jstree that looks like this</p>
  
  <pre><code>&lt;div id="jstree"&gt;
    &lt;ul id="root"&gt;
      &lt;li&gt;2013
        &lt;ul&gt;
          &lt;li class="jan"&gt;Jan&lt;/li&gt;
          &lt;li class="feb"&gt;Feb&lt;/li&gt;
          &lt;li class="mar"&gt;Mar&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;2014
        &lt;ul&gt;
          &lt;li class="jan"&gt;Jan&lt;/li&gt;
          &lt;li class="feb"&gt;Feb&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What I want to do is rename all Nodes from class "feb" for example, but my attempts with rename_node or set_text doesn't work. Can someone please tell me how I can do this?</p>
  
  <p>EDIT : By rename, I mean change the html text inside the node. So for example, if I want to change all Node of class feb and name them "February", the Output for all node of class feb will be</p>
  
  <pre><code>&lt;div id="jstree"&gt;
    &lt;ul id="root"&gt;
      &lt;li&gt;2013
        &lt;ul&gt;
          &lt;li class="jan"&gt;Jan&lt;/li&gt;
          &lt;li class="feb"&gt;February&lt;/li&gt;
          &lt;li class="mar"&gt;Mar&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;2014
        &lt;ul&gt;
          &lt;li class="jan"&gt;Jan&lt;/li&gt;
          &lt;li class="feb"&gt;February&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <p>EDIT 2 : I made a simplified code so you can understand where my problem is. Here is my html</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;test&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="css/style.css"&gt;
      &lt;link rel="stylesheet" href="dist/themes/default/style.min.css"&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="menu" class="ui-widget-content"&gt;
        &lt;div id="jstree"&gt;
          &lt;ul id="root"&gt;
          &lt;/ul&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;script src="jquery/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="dist/jstree.min.js"&gt;&lt;/script&gt;
      &lt;script src="jquery/functions.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And Here is my javascript file (saved in jquery/functions.js):</p>
  
  <pre><code>$(function() {
    var actDate = new Date("2014-10-17");
    var frstDate = new Date("2013-05-10");
    var aD = new Date(frstDate);
  
    // The following double loop create the tree nodes
    for(var i = frstDate.getFullYear(); i &lt;= actDate.getFullYear(); i++){
      aD.setFullYear(i);
  
      var yearNode = $('&lt;li&gt;', {
        class: i.toString()
      }).text(i.toString());
  
      var year = $('&lt;ul&gt;');
      year.appendTo(yearNode);
  
      for(var j = 0; j &lt;= 11; j++){ // jan = 0, feb = 1 etc.
        aD.setMonth(j);
        if(aD &gt; frstDate &amp;&amp; aD &lt; actDate){
        // Add for loop for Days here
        if(j==0){$('&lt;li&gt;', {class: 'jan'}).text("jan").appendTo(year);}
        else if(j==1){$('&lt;li&gt;', {class: 'feb'}).text("feb").appendTo(year);}
        else if(j==2){$('&lt;li&gt;', {class: 'mar'}).text("mar").appendTo(year);}
        else if(j==3){$('&lt;li&gt;', {class: 'apr'}).text("apr").appendTo(year);}
        else if(j==4){$('&lt;li&gt;', {class: 'may'}).text("may").appendTo(year);}
        else if(j==5){$('&lt;li&gt;', {class: 'jun'}).text("jun").appendTo(year);}
        else if(j==6){$('&lt;li&gt;', {class: 'jul'}).text("jul").appendTo(year);}
        else if(j==7){$('&lt;li&gt;', {class: 'aug'}).text("aug").appendTo(year);}
        else if(j==8){$('&lt;li&gt;', {class: 'sep'}).text("sep").appendTo(year);}
        else if(j==9){$('&lt;li&gt;', {class: 'oct'}).text("oct").appendTo(year);}
        else if(j==10){$('&lt;li&gt;', {class: 'nov'}).text("nov").appendTo(year);}
        else if(j==11){$('&lt;li&gt;', {class: 'dec'}).text("dec").appendTo(year);}
        }
      }
      yearNode.appendTo($('#root'));
    }
  
    $('#jstree').jstree(); // creation of the tree : tree is normally displayed
  
    // The following prints "not done"
    if($('#jstree').jstree().rename_node(
      $('#jstree').jstree().get_node(".feb"),
      "February"))
    {
      alert("done");
    }
    else{
      alert("not done"); 
    }
    $('#jstree').jstree('rename_node', [$('#j1_10'), "February"]); // same, does not work
    $('li ul li.feb').text('February'); // does not work neither.
  
    // I tried other things (like set_text) but none of them worked.
  });
  </code></pre>
  
  <p>I enter a first date and the actual Date and a Tree of month and year is shown in a jstree. The tree is displayed correctly, but all of my tries didn't work and I don't understand where i'm doing it wrong.</p>