JQuery val() does not work for textarea in Opera

后端 未结 10 1055
盖世英雄少女心
盖世英雄少女心 2021-01-12 11:33

I am displaying a modal dialog using jQuery. This dialog has a textarea control on it. But while submitting this dialog, the value of this textarea

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-12 12:08

    I use this workaround:

    
    if (window.opera)
    {
      document.addEventListener('focus', function(event){
        if (event.target instanceof HTMLTextAreaElement)
        {
          event.target.contentEditable = true;
          event.target.contentEditable = false;
        }
      }, true);
    }
    

提交回复
热议问题