Apply CSS upon query string - My code does not work, but why? : <p>I have a popup message "Your invitation has been sent" on this page: <a href="https://idio.ai/thank-you-webinar-testing-ground/?referralsent=true" rel="nofollow noreferrer">https://idio.ai/thank-you-webinar-testing-ground/?referralsent=true</a></p>

<p>What I'd like to achieve to only show this message when the URL has this query string on it</p>

<blockquote>
  <p>?referralsent=true</p>
</blockquote>

<p>On the class ".message" there is a <strong>display: none</strong> by default which needs to be changed to <strong>display: block</strong> in case the query string is there.</p>

<p>Here is my script so far but it does not work and I can't figure out why.</p>

<pre><code>function getParameterByName(referralsent, url) {
    if (!url) url = window.location.href;
    referralsent = referralsent.replace(/[\[\]]/g, '\\$&amp;');
    var regex = new RegExp('[?&amp;]' + referralsent + '(=([^&amp;#]*)|&amp;|#|$)'),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, ' '));
}

if (getParameterByName('referralsent')) {
        var referralsent = getParameterByName('referralsent');
        // replace only if available
        jQuery('message').css('display', 'block');
    }
</code></pre>

<p>What is wrong here why is it not showing? Any ideas?</p>
