How to get specific part of url between two strings in jQuery : <p>I am trying to extract a specific ID from the url I have.</p>

<p><a href="https://myhost.com/ReferredSummary.aspx?PolicyId=4807307&amp;EndorsementId=5941939&amp;EditExisting=true&amp;NewClient=true&amp;Adjustment=True" rel="nofollow noreferrer">https://myhost.com/ReferredSummary.aspx?PolicyId=4807307&amp;EndorsementId=5941939&amp;EditExisting=true&amp;NewClient=true&amp;Adjustment=True</a></p>

<p>the ID I need is = 4807307
It always have the strings PolicyId= before and &amp;EndorsementId= after.</p>

<p>How Can I extract the the from the url.</p>
