title: How do I add a comment to an image using jQuery
body: <p>So I am trying to replicate Facebook's picture tagging functionality, and I have the functionality that onClick, a box is created and there is a comment box.</p>
  
  <p>Now the issue is that I want to be able to (without doing any back-end processing) take the input from the input field and add it in some form to the underlying image area that they have selected. I would also like to add a small image to that area, that shows that a comment is there.</p>
  
  <p>How do I do that?</p>
  
  <p>See the code below for what I have for the comment box:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $(function() {
              var tag_box = $("&lt;div&gt;").appendTo("body").css({
                  "width": "40px",
                  "height":"40px",
                  "border":"4px solid #000000",
                  "position":"absolute",
                  "display":"none", 
                  "padding":"15px"
                  });
  
          var comment_box = $("&lt;form action='#'&gt;&lt;input id='comment' type='text' name='comment' placeholder='Add comment'&gt;&lt;/form&gt;").appendTo(tag_box).css({"position":"absolute"});            
  
          $("#image-wrapper").live('click', function(e){
              tag_box.css({
                  "left": e.pageX - 40,
                  "top": e.pageY - 40, 
                  "display": "block"
                  })
              .after(comment_box.css({
                  "left": e.pageX - 65,
                  "top": e.pageY + 40
              }));
  
              });
  
          });
  
  
  &lt;/script&gt;
  &lt;body&gt;    
  &lt;div align="center"&gt;  
  
      &lt;img src="images/test.gif" width="760" height="182" alt="test" id="image-wrapper"&gt;
  
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Now...whenever the user presses enter, the info in the comment box is appended to the URL like so: </p>
  
  <p>.html?comment=comment value#</p>
  
  <p>Thanks</p>
  
  <p>Edit: My bad...I left out HTML...I have appended it to the script tag above.</p>