title: jQuery $("#" + x) does not work, but document.getElementById(x) works
body: <h2>The problem</h2>
  
  <p>I'm trying to change the inner HTML value of an element. I've not used jQuery really much and I'm still a novice in many aspects of its functionalities.</p>
  
  <pre><code>    $('a.toggle-download').live('click', function (event) { 
          $.post("/ajax/toggle-download", { code: $(this).data("document"), prev_value: $(this).data("val") })
          .done(function(data) {
              var json = data,
              obj = JSON &amp;&amp; JSON.parse(json) || $.parseJSON(json);
              if(obj['return'] == 1){
                  //document.getElementById("p_" + obj['code']).innerHTML = 'some text';
                  $("#p_" + obj['code']).html('some text');
              }
          });
          event.preventDefault();
      });
  </code></pre>
  
  <p>I've tried both lines, first the jQuery one through <code>$("#p_" + obj['code'])</code>, which did not work and then through <code>document.getElementById("p_" + obj['code'])</code> which works perfectly.</p>
  
  <p>It seems I'm missing something obvious here, but still i don't understand why jquery does not work in this case!</p>
  
  <h2>The question</h2>
  
  <p>Why does the plain old javascript work correctly, when jQuery does not?</p>
  
  <h2>Additional informations</h2>
  
  <p>1) jQuery itself works and it's correctly loaded. No conflicts are present: the ajax call is sent successfully and the answer is correctly received,</p>
  
  <p>2) The received ID exists and it's unique</p>
  
  <p>3) I'm not keen on <a href="http://api.jquery.com/html/">jQuery html() method</a> but i followed the documentation and it should work as i used it</p>
  
  <h2>System information</h2>
  
  <p>This problem presents itself while using Chrome 27.0.1453.116 m. I didn't tested it with other versions or other browsers, but i'm quite sure to presume that's a jQuery problem rather than a browser problem. Also, i'm using php 5.3 on apache, but again these info should not be relevant to the problem.</p>
  
  <p>If I missed some information you need to better understand my problem, please let me know in the comments and I'll try to answer you as soon as i can. Also, please forgive my bad grammar but I'm not a native english speaker.</p>
  
  <h2>Answers to comments</h2>
  
  <p>as requested, here's an example of the ajax response:
  <code>{"return":1,"code":"5.43.321"}</code></p>
  
  <p>the command <code>console.log($("#p_" + obj['code']).length)</code> yields "0"</p>