title: How to console log input val?
body: <p>I am trying to apply to an <code>input.val()</code> a <code>text</code> from a <code>span</code> element but when I try to check it in <code>console</code> I don't get it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#sandbox-container span").on("click", function(e) {
        $("#sandbox-container span").removeClass("selected_year");
        $(this).attr("class", "selected_year");
        var dateSelected = $(".selected_year").text();
        var dateCat = $(".time_value").val(dateSelected);
        console.log(dateSelected);
        console.log(dateCat);
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="sandbox-container"&gt;
        &lt;span class="selected_year"&gt;2014&lt;/span&gt;
        &lt;span&gt;2018&lt;/span&gt;
      &lt;/div&gt;
  &lt;input label="null" style="display: none;" class="time_value" maxlength="99" name="usp-category" type="text" value=""&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The above gives me:</p>
  
  <pre><code>2014
  (index):208 r.fn.init [prevObject: r.fn.init(1)]
  </code></pre>
  
  <p>While I would expect <code>console.log(dateCat);</code> to give me <code>2014</code></p>