Coupon code validation funcanality using javascript or jquery
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function validate(coupon) {
    var myRe = "LUCKY100";
    if(cvv.value.match(myRe)) {
        return true;
    } else {
        document.getElementById('couponerror').innerHTML="Invalid coupon";
        return false;
    }
} </code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form onsubmit="validate(coupon)"&gt;
&lt;label style="width:50px;"&gt;&lt;input type="text" name="coupon" class="coupon" title="Enter coupon" o &gt;
&lt;/p&gt;&lt;span id="usernameError"&gt;&lt;/span&gt;&lt;/label&gt;
&lt;input type="button"  value="Submit" /&gt;</code></pre>
</div>
</div>
</p>

<p>I am new to jquery my question is I need a copon code validation method like I assign a coupon code that is LUCKY100 &amp; if user enter in input type diffrent value it give error message below to input field not alert &amp; if user enter LUCKY100 it gives message coupon applied successfully. Kindly provide me html of this validation and javascript or jquery.
Thanks in advance</p>