社区
JavaScript
帖子详情
如何改变type属性
lljllj2000
2002-04-04 08:54:25
如何用button改变一个 type="hidden"的input为 type="button"?
<INPUT name="cancle" type="hidden" value="111">
<INPUT name="ok" onclick="ok_action()" type="button" value="確定">
...全文
97
5
打赏
收藏
如何改变type属性
如何用button改变一个 type="hidden"的input为 type="button"?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Reve
2002-04-04
打赏
举报
回复
cancle.outerHTML='<INPUT name="cancle" type="button" value="111">';
karma
2002-04-04
打赏
举报
回复
According to MSDN documentation:
As of Microsoft® Internet Explorer 5, the type property is read/write-once, but only when an input element is created with the createElement method and before it is added to the document.
weidegong
2002-04-04
打赏
举报
回复
Perhaps,you can use it in this way:
<form name=mxh1>
<input id=mxh style="visibility:hidden">
<input name=aa type=radio onclick="document.all.mxh.style.visibility='visible'">显示
<input name=aa type=radio onclick="document.all.mxh.style.visibility='hidden'">隐藏
</form>
<script>
for(var i=0;i<document.mxh1.elements.length;i++)
{
if(document.mxh1.elements[i].type=="radio")
document.mxh1.elements[i].checked=""
}
</script>
BrentIvan
2002-04-04
打赏
举报
回复
<script language="JavaScript">
function changeType() {
document.all.oDiv.innerHTML = "<input type=\"button\" name=\"oInput\" id=\"oInput\">";
}
</script>
<div name="oDiv" id="oDiv"><input type="hidden" name="oInput" id="oInput" value="1"></div>
<input type="button" value="click me" onclick="changeType()">
孟子E章
2002-04-04
打赏
举报
回复
不可以修改:
可以这样
<form>
<INPUT name="cancle" type="button" value="111" style="display:none">
<INPUT name="ok" onclick="cancle.style.display='block'" type="button" value="確定">
</form>
jquerymobile设计完整例子
jquerymobile例子 包含从登陆到菜单和各种菜单切换完整设计 上传只为分享
前端CSS input
type
属性
详解
input在前端中使我们需要熟悉使用的一个标签,input中
type
属性
值不止text一个。 可定义单行输入字段,用户可以自定义输入文字,默认最多输入20个。placeholder为文本框初始默认的文字效果图: value是按钮中的文字。效果图:submit和button的区别是可以点击回车就可以触发按钮,提交表单 效果图:定义一个单选的按钮,可以定义checked=“checked”强制勾选,同时也可以使用disabled使按钮不可选效果图: 定义一个可以勾选的按钮,与上一个rad
jQuery/Js动态修改Input的
Type
属性
试图修改 Input
属性
,如 $(this).attr('
type
','password'); 或 $(this)[0].
type
= 'password'; 都是不可以的 jQuery无法修改 Input 的
Type
属性
,因为源码中: // We can't allow the
type
property to be changed (since itcauses ...
【input 标签的
type
属性
详解】
input 标签的
type
属性
详解1. input 输入标签的
type
属性
1.1 input 标签的
type
类型
属性
的常用
属性
值⑴
type
="text"⑵
type
="button"⑶
type
="checkbox"⑷
type
="file"⑸
type
="hidden"⑹
type
="image"⑺
type
="password"⑻
type
="radio"⑼
type
="rese...
input标签的
type
属性
汇总
1.单行输入框< input
type
=“text”/> 单行文本输入框常用来输入简短的信息,如用户名、账号等,常用的
属性
有name、value、 maxlength。 2.密码输入框< input
type
=" password"/> 密码输入框用来输入密码,其内容将以圆点的形式显示。 3.单选按钮< input
type
=" radio"/> 单选按钮用于单项选择,如选择性别、是否操作等。需要注意的是,在定义单选按钮时,必须为同一组中的选项指定相同的name值,这样“
JavaScript
87,993
社区成员
224,687
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章