最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Copy-paste in textarea doesn't work in Chrome - Stack Overflow

programmeradmin0浏览0评论

I have a little mystery.

When you have a div { display: none; } rule in your css, and a textarea on the page, it is impossible to copy and paste in the textarea in a Chrome browser.

What's going on?

.html

I have a little mystery.

When you have a div { display: none; } rule in your css, and a textarea on the page, it is impossible to copy and paste in the textarea in a Chrome browser.

What's going on?

http://pastehtml./view/ax3tuefz3.html

Share Improve this question edited Jul 7, 2011 at 1:29 Acorn asked Jun 14, 2011 at 11:57 AcornAcorn 50.6k30 gold badges141 silver badges179 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 2

I tried and yes the paste seems to be broken in your example.

There were some bugs reported on chrome buglist:

http://code.google./p/chromium/issues/detail?id=60057

http://code.google./p/chromium/issues/detail?id=61784

But they are long closed.

This is a bug in WebKit.

I've filed a bug report here: https://code.google./p/chromium/issues/detail?id=86025

Your problem isdisplay:none; is applying to all your divs.

I gave your button a class:

<div id="login" class="login">

And made sure the display:none; only applied to it

div.login {
    display: none;
}

Then I hid your form off the top

$('#view_form').hide();

Works now: http://jsbin./umugi5/3/

发布评论

评论列表(0)

  1. 暂无评论