<form > <p> Fisrt Name: <input id="fname1" class="input" type ="text"/> </p> <pre lang="xml"><button id="sub" class="btn-danger">Save </button> </form> jquery code <pre lang="cs">$(document).ready(function (){ $(&quot;#sub&quot;).click(function(){ //submit btn var ffname = $(&quot;#fname1&quot;); //fisrst name var lname = $(&quot;#lname1&quot;); var nic = $(&quot;#nic&quot;); var eml1 = $(&quot;#eml&quot;); var tp = $(&quot;#tp&quot;); if(ffname.val() ==&quot;&quot;){ $(&quot;this&quot;).css(&quot;background-color&quot; , &quot;red&quot;); } else { $(&quot;this&quot;).css(&quot;background-color&quot; , &quot;green&quot;); } }); });</pre></pre>
$(this).css('background-color', 'red');
$("this").css("background-color", "red");
$(this)
ffname.css('background-color', 'red');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)