How do i change Background color of textbox when onfocus?

后端 未结 5 1931
栀梦
栀梦 2021-01-16 05:31

i tried this code but its not working.. when i on-focus textbox it shows error

   function ChangeBgColor(obj, evt) 
    { 
            if(evt.type==\"focus\"         


        
5条回答
  •  情歌与酒
    2021-01-16 06:27

    Try doing it with jQuery.

    $('#div').on('focus', function() {
        $(this).css({background:'blue'});
    });
    

提交回复
热议问题