更新时间:2023-02-12 10:07:23
将第二个bgColor替换为$(this).val().
bgColor
$(this).val()
您已将起始值分配给bgColor,然后再也不会为其重新分配新值.
You have assigned the starting value to bgColor, and then you never reassign a new value to it.
jsFiddle .
使用jQuery根据输入字段值更新backgroundColor LIVE?