Event handler for a html5 color input element

后端 未结 3 576
南方客
南方客 2020-12-18 19:11

Using the new input=\"color\" element within Chrome triggers a new popup dialog:

\"screenshot

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 19:36

    To get the value of color input, you should use the event attribute onchangeprovided in w3school

    
    

    and define a function that handle the event

     function getColorVal(colorValue){
    
         alert(colorValue);
    }
    

提交回复
热议问题