title: focus on dynamically generated div
body: <p>I am generating div in the controller dynamically .there can be n number of div's.I am doing this by ajax and in the response i am generating div.and now on keydown i want to focus on this div.i manage to do keydown effect.I tried focus but its not working.
  Here is my div generated dynamically in the controller</p>
  
  <pre><code>echo '&lt;div class="col-md-12 srch-result" style="cursor:pointer;text-indent:10px;padding:5px 0px 5px 3px" data-uid="'.$rows-&gt;user_id.'" data-uname="'.$rows-&gt;firstname." ".$rows-&gt;lastname.'"&gt;'.str_ireplace($keyword,'&lt;b&gt;'.$keyword.'&lt;/b&gt;',$rows-&gt;firstname." ".$rows-&gt;lastname).'&lt;/div&gt;'
  </code></pre>
  
  <p>and my code in the view to append this result inside a div</p>
  
  <pre><code>$('#page_to').keyup(function(){
  
              var keyword = $('#page_to').val();
  
              $.ajax({
                  type:'POST',
                  url:'&lt;?php echo base_url("user/userlist"); ?&gt;',
                  data:'keyword='+keyword,
                  success:function(response)
                  {
                      $('#search-result').show();
                      $('#search-result').show('1000');
                      $('#search-result').html(response);
                  }
  
  
              });
  
          });  
  </code></pre>