TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why can't I copy and paste into HTML fields?

1 点作者 danmccorm大约 9 年前
I've noticed a trend to prevent copying and pasting into HTML fields which I find quite irrational. Doesn't accuracy increase if I'm allowed to copy and paste something? Presently, I'm prevented from copying a checking account number into a field, so I have to type it out by hand, which is much more error-prone. Does anyone know why sites do this?

1 comment

lsiunsuex大约 9 年前
1 reason I can think of is when copying and pasting - the text formatting used from where you copied the string from can come over with the text. So your not pasting in just a number but potentially html &#x2F; css with it.<p>For obvious reasons, this could be a problem and instead of stripping the html &#x2F; css &#x2F; garbage - it&#x27;s easier to just prevent the action entirely.