jquery Selector for input value

后端 未结 5 823
夕颜
夕颜 2020-12-15 02:54

i have here the code..

 
5条回答
  •  清歌不尽
    2020-12-15 03:28

    This does it:

    $("div > input[value=hello]").parent().css("color", "red");
    

    Live example

    Or if by "color" you really meant "background color":

    $("div > input[value=hello]").parent().css("background-color", "red");
    

    Live example

提交回复
热议问题