Javascript - check if string is valid CSS color?

前端 未结 6 1335
一生所求
一生所求 2021-01-01 23:25

If a color string is a number, then we can use a RegExp to check if it\'s a valid CSS color. But what if it\'s a word?

I have code that generates contro

6条回答
  •  死守一世寂寞
    2021-01-02 00:07

    $(funtion(){ var obj = $("p"); var ex = $(obj).eq(1); $("button").click(funtion(){ alert(obj); }); });

    Does this solve the problem?

提交回复
热议问题