if$#sku.val.length

  1. Faun

    [SOLVED][JAVASCRIPT] setting class of an element using function

    I have this input element with id "sku" I am using this function sku.keyup(function(){ if($("#sku").val().length < 4) { $("#sku").attr("class","error"); }else { $("#sku").attr("class","ok"); } }) $('#sku').blur(function(){ if($("#sku").val().length < 4) {...
Top Bottom