Placeholder not working for Internet Explorer

后端 未结 7 1493
青春惊慌失措
青春惊慌失措 2020-12-02 13:47

Placeholder for my textbox in below format is not working for Internet Explorer. Is there anyway to display placeholder for TextBox in Internet Explorer?

7条回答
  •  不思量自难忘°
    2020-12-02 14:10

    Placeholder is an HTML5 feature. To work around I detect MSIE and do this:

    if ( $.browser.msie ) {
        $("#textarea-id").val('placeholder');
        $("#textarea-id").focus(function(){
            this.select();
        });
    }
    

    Its jquery but not that complicated...

提交回复
热议问题