CSS: How make the cursor to become a pointer on the input file?

后端 未结 6 734
时光取名叫无心
时光取名叫无心 2021-01-06 03:25

How can I make the cursor to become a pointer on an input file or an input text when you hover it?

My try but it does not work of course,



        
6条回答
  •  梦毁少年i
    2021-01-06 04:15

    You can put an image instead, and do it like this:

    HTML:

    
    
    

    JQuery:

    $("#upfile1").click(function () {
        $("#file1").trigger('click');
    });
    

    CAVEAT: In IE9 and IE10 if you trigger the onclick in a file input via javascript the form gets flagged as 'dangerous' and cannot be submmited with javascript, no sure if it can be submitted traditionaly.

提交回复
热议问题