textarea 鼠标无法固定在左上角的解决方法

221 阅读1分钟
<textarea rows="5" style="resize:none;" id="liutext" onmousedown="s(event,this)"></textarea>

   <script>
    function s(e, a) {
        if (e && e.preventDefault)
            e.preventDefault();
        else
            window.event.returnValue = false;
        a.focus();

    }
    $(function() {
        $("#liutext").click(function() {
            $("#liutext").css("background", "#ffffff")
        })
    })
   </script>