js实现复制功能
最编程
2024-02-15 07:32:19
...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>自动选择文本框/编辑框中的文字</title>
<script type="text/javascript">
function Myselect_txt(){
if (document.form1.title.focus){
document.form1.title.select();}
}
function Myselect_txtarea(){
if (document.form1.content.focus){
document.form1.content.select();}
}
</script>
</head>
<body style="font-size:12px">
<table width="443" height="97" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f9f9f9">
<form name="form1">
<tr bgcolor="#214994">
<td height="25" colspan="2"><div align="center"><font color="#FFFFFF">新闻信息修改</font></div></td>
</tr>
<tr>
<td width="80" height="28"><div align="right"><font color="#214994">新闻标题:</font></div></td>
<td width="363"><input name="title" type="text" size="50" value="今日新闻头条" onClick="Myselect_txt()"></td>
</tr>
<tr>
<td height="20"><div align="right"><font color="#214994">新闻内容:</font></div></td>
<td rowspan="2"><textarea name="content" cols="50" rows="6" onClick="Myselect_txtarea()">今日,据相关方面报道,...</textarea></td>
</tr>
<tr>
<td height="10"> </td>
</tr>
<tr>
<td height="32" colspan="2">
<div align="center">
<input name="add" type="submit" id="add" value="添加">
<input name="Submit" type="reset" value="重置">
</div></td>
</tr>
</form>
</table>
</body>
</html>
上一篇: 使用原生JavaScript实现复制功能
推荐阅读
-
C# Winfrom 实现天际线绘制直线功能的示例代码
-
在 vue 下为评论实现 @ 提及功能
-
ES6 JS 防抖动节流实现
-
Qt 实现的简单视频播放器,功能包括选择视频、播放、暂停、前进、后退、拖动进度条、显示视频长度等
-
使用 ganache 实现 Web3js 与区块链交互的步骤及问题解决方案:未找到命令 "express "等。
-
html5 canvas+js 实现 ps 笔抠字(快速抠字 www.sukoutu.com)
-
[数据可视化] D3.js 实现动态气泡图
-
在多种不同的 Common Lisp 实现(CLISP、CCL、SBCL)中执行 shell 命令的功能
-
Vue3+cropperjs 实现图像裁剪功能
-
js 实现输入的 ID 号,以得出生日、年龄和性别