zoukankan
html css js c++ java
动态改变input标记类型
<!
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
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=utf-8"
/>
<
title
>
无标题文档
</
title
>
<
script
type
="text/javascript"
>
function
ChangeInputType(inputType)
{
var
oldControl
=
document.getElementById(
"
testControl
"
);
var
controlParent
=
oldControl.parentNode;
var
newControl
=
document.createElement(
"
input
"
);
newControl.setAttribute(
"
type
"
,inputType);
controlParent.appendChild(newControl);
controlParent.removeChild(oldControl);
}
</
script
>
</
head
>
<
body
>
<
input
type
="button"
value
="changeType"
onclick
="ChangeInputType('file');"
/>
<
div
>
<
input
type
="text"
id
="testControl"
/>
</
div
>
</
div
>
</
body
>
</
html
>
查看全文
相关阅读:
js中通过Object.prototype.toString方法----精确判断对象的类型
leecode---dfs,array,局部和全局---152. Maximum Product Subarray
leecode96---dfs,dp,tree---96. Unique Binary Search Trees
leecode115---dfs,string---Distinct Subsequences
JVM:G1垃圾回收器
java基础---JVM---CMS垃圾回收器
java基础---JVM---调优,垃圾收集器,内存分配策略
java基础---JVM---java内存区域与内存溢出问题
java基础---一致性hash算法
java基础---多态的实现原理
原文地址:https://www.cnblogs.com/ywkpl/p/1088639.html
最新文章
Java Code Examples for io.netty.util.concurrent.GlobalEventExecutor
python实现自动化统计数据表内容并发送邮件至指定联系人
ip以及端口转发数据、根据端口转发显示内网的web的方法介绍
python list的深浅copy
webbench压力测试部署步骤
centos6.5增加用户,使其具有root权限
fiddler中QuickExec命令行和键盘快捷键的使用
python的requests模块实现登录后的接口操作
python 定时器使用
python27+selenium3自动化登录测试
热门文章
python发送邮件
NODE_ENV=production关于不同系统的写法
JavaScript下实现交换数组元素上下移动例子
react-router解决锚点跳转问题
Javascript函数节流
前端表单验证常用的15个JS正则表达式
双重非位运算简写
如何发布自己的node模块
node设置跨域
webpack配置接口路径
Copyright © 2011-2022 走看看