zoukankan
html css js c++ java
在光标处添加文字,或对选择的文字进行更改(JS:TextRange)
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
>
Untitled Page
</
title
>
<
script
language
="javascript"
type
="text/javascript"
>
function
Blod()
{
Format(
"
粗体
"
,
"
'''
"
);
}
function
Italic()
{
Format(
"
斜体
"
,
"
''
"
);
}
function
Format(formatName,format)
{
var
textarea
=
document.getElementById(
"
txaContent
"
);
if
(textarea.pos
!=
null
)
{
var
s
=
textarea.pos.text;
if
(s
==
null
||
s
==
'undefined'
||
s
==
'')
{
s
=
formatName ;
}
s
=
format
+
s
+
format;
textarea.pos.text
=
s;
}
else
{
textarea.value
+=
format
+
formatName
+
format;
}
}
</
script
>
</
head
>
<
body
>
<
textarea
id
="txaContent"
cols
="20"
rows
="20"
onselect
="this.pos = document.selection.createRange();"
onclick
="this.pos = document.selection.createRange();"
onkeyup
="this.pos = document.selection.createRange();"
></
textarea
>
<
input
type
="button"
onclick
="Blod()"
value
="Blod"
id
="btnBlod"
/>
<
input
type
="button"
onclick
="Italic()"
value
="Italic"
id
="btnItalic"
/>
</
body
>
</
html
>
查看全文
相关阅读:
Group Normalization
Resnet小记
Mxnet 查看模型params的网络结构
ResNets和Inception的理解
基础 | batchnorm原理及代码详解
交叉熵代价函数原理
深度学习笔记:优化方法总结(BGD,SGD,Momentum,AdaGrad,RMSProp,Adam)
机器学习 logistic分类
ubuntu16.04 安装搜狗输入法
工作5年半了,最近准备做一些工作的小结了
原文地址:https://www.cnblogs.com/think/p/328907.html
最新文章
什么是一致性Hash算法?
eclipse如何将项目上传到码云
mysql数据库中的数据导入与导出
spark之JDBC开发(连接数据库测试)
spark之JDBC开发(实战)
支付宝扫敬业福攻略
spark之scala程序开发(集群运行模式):单词出现次数统计
spark之scala程序开发(本地运行模式):单词出现次数统计
spark之java程序开发
scala程序开发入门
热门文章
Spark内存管理机制
Shuffle过程
Spark的核心RDD(Resilient Distributed Datasets弹性分布式数据集)
Linux常用命令大全(非常全!!!)
eclipse导入别人工程项目后,出现红叉的各种情况
博客园打赏设置
maven创建一个简单的web项目
maven安装、配置及创建工程
mybatis是如何防止SQL注入的
mxnet卷积计算
Copyright © 2011-2022 走看看