title: on click event not working with anchor tag
body: <p>I have created a script <code>onClick</code> function not working with anchor tag I don't know why I am clicking on it and nothing is happening</p>
  
  <pre><code>$(".addname").on("click", function() {
    var username = $(this).attr('title');
    var old = $("#contentbox").html();
    var content = old.replace(word, "");
    $("#contentbox").html(content);
    var E = "&lt;a class='red' contenteditable='false' href='#' &gt;" + username + "&lt;/a&gt;";
    $("#contentbox").append(E);
    $("#display").hide();
    $("#msgbox").hide();
    $("#contentbox").focus();
  });
  
  
  
  &lt;div id="contentbox" contenteditable="true"&gt;&lt;/div&gt;
  
  
  if($_POST)
  {
  $q=$_POST['searchword'];
  $q=str_replace("@","",$q);
  $q=str_replace(" ","%",$q);
  $sql_res=mysql_query("select * from users where name like '%$q%' order by id LIMIT 5");
  while($row=mysql_fetch_array($sql_res))
  {
  $fname=$row['name'];
  
  
  ?&gt;
  &lt;div class="display_box" align="left"&gt;
  &lt;img src="user_img/test.jpg" class="image"/&gt;
  &lt;a href="#" class='addname' title='&lt;?php echo $fname; ?&gt;'&gt;
  &lt;?php echo $fname; ?&gt; &lt;/a&gt;&lt;br/&gt;
  &lt;?php
  }
  }
  ?&gt;
  </code></pre>
  
  <p>Please see my above question now as of I am adding data dynamically and the button adding dynamically is included within the dynamic data coming from the other file</p>