How to change input border-color, with jQuery, depending on its value?

后端 未结 3 1981
一生所求
一生所求 2021-02-19 09:25

I have question about jQuery. I have code below which works fine; it changes input border-color depending on its value, which is typed and entered. But

3条回答
  •  情书的邮戳
    2021-02-19 10:03

    Just trigger the event:

    $("input").change(function() {
        // ...
    }).trigger("change");
    

    DEMO: http://jsfiddle.net/9B5SX/1/

提交回复
热议问题