Get the input value of "ANY" element <p> tag

Get the input value of "ANY" element <p> tag

Hi Guys,

I am having difficulty getting the value of a specific value contained in a <p> tag, what is happening is that it retrieves the value of the first <p> tag value and not the one the user clicks

What I need is to retrieve the value from the <p> tag the user clicked

$(document).ready(function() {   
                   
   $("p").click(function () {
   var prop = $("#property_links").val();
   $.post("n10-shortlist-connector.html", { web_AGENT_REF: prop});
         var htmlStr = "Added to Compare Tool";
       $(this).text(htmlStr);
                     });
                         
                  });   


<p><a style="cursor:pointer; color: #900">  Add to Compare Tool <input type="hidden" id="property_links" value="<? echo $AGENT_REF; ?>"/></a></p>      //    many of these tags on the page


View Page: http://nwbeta.itproz.co.uk/residential- ... =Liverpool

If viewing the site when you click "add to compare list" it will change to "Added to compare list"

All help appreciated,



Thanks in advance.