应该可以
TYPE Attribute | type Property--------------------------------------------------------------------------------Initially sets and then retrieves the type of INPUT control represented by the object.SyntaxHTML <ELEMENT TYPE = sType ... >
Scripting object.type [ = sType ] Possible ValuessType String that specifies or receives one of the following INPUT control values: button Creates a button control.
checkbox Creates a checkbox for simple Boolean attributes or for attributes that can take multiple values at the same time. The input consists of a number of check box controls, each of which has the same name. Each selected check box generates a separate name/value pair in the submitted data, even if this results in duplicate names. The default value is on.
file Creates a file upload object.
hidden Creates a control hidden from the user, but the value of the value property is sent with the submitted form.
image Creates an image control that can be clicked, causing the form to be immediately submitted. The coordinates of the selected point are measured in pixels from the upper-left corner of the image and are submitted with the form as two name/value pairs. The x-coordinate is submitted under the name of the control with .x appended, and the y-coordinate is submitted under the name of the control with .y appended. Any value property is ignored. The image is specified by the src property, exactly as for the IMG object
password Creates a control similar to the text control, except that text is not displayed as the user enters it.
radio Creates radio buttons used for mutually exclusive sets of values. Each radio button control in the group should be given the same name. Only the selected radio button in the group generates a name/value pair in the submitted data. Radio buttons require an explicit value property.
reset Creates a button that resets the form's controls to their specified initial values. You can specify the label to display on this button just as you can for the Submit button.
submit Creates a button that submits the form. Use the VALUE attribute to specify a label that is displayed on the button. The default label is application-specific. Click the Submit button and the associated control objects submit name/value pairs to the server.
text Default. Creates a single-line text-entry control. Use the value in conjunction with the size and maxLength properties.
The property is read/write. The property has a default value of text.Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.ResAs of Microsoft?Internet Explorer 5, the type property is read/write-once, but only before an INPUT element created with the createElement method is added to the document.
TYPE Attribute | type Property--------------------------------------------------------------------------------Initially sets and then retrieves the type of INPUT control represented by the object.SyntaxHTML <ELEMENT TYPE = sType ... >
Scripting object.type [ = sType ] Possible ValuessType String that specifies or receives one of the following INPUT control values: button Creates a button control.
checkbox Creates a checkbox for simple Boolean attributes or for attributes that can take multiple values at the same time. The input consists of a number of check box controls, each of which has the same name. Each selected check box generates a separate name/value pair in the submitted data, even if this results in duplicate names. The default value is on.
file Creates a file upload object.
hidden Creates a control hidden from the user, but the value of the value property is sent with the submitted form.
image Creates an image control that can be clicked, causing the form to be immediately submitted. The coordinates of the selected point are measured in pixels from the upper-left corner of the image and are submitted with the form as two name/value pairs. The x-coordinate is submitted under the name of the control with .x appended, and the y-coordinate is submitted under the name of the control with .y appended. Any value property is ignored. The image is specified by the src property, exactly as for the IMG object
password Creates a control similar to the text control, except that text is not displayed as the user enters it.
radio Creates radio buttons used for mutually exclusive sets of values. Each radio button control in the group should be given the same name. Only the selected radio button in the group generates a name/value pair in the submitted data. Radio buttons require an explicit value property.
reset Creates a button that resets the form's controls to their specified initial values. You can specify the label to display on this button just as you can for the Submit button.
submit Creates a button that submits the form. Use the VALUE attribute to specify a label that is displayed on the button. The default label is application-specific. Click the Submit button and the associated control objects submit name/value pairs to the server.
text Default. Creates a single-line text-entry control. Use the value in conjunction with the size and maxLength properties.
The property is read/write. The property has a default value of text.Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.ResAs of Microsoft?Internet Explorer 5, the type property is read/write-once, but only before an INPUT element created with the createElement method is added to the document.
解决方案 »
- 为何我访问不了父页面的父页面?
- 问题求助
- 用insertRow()方法插入新行时,怎么设置该行的事件处理呢?
- JS闭包解除引用问题
- 输入密码错误后怎样保留用户名啊
- 如何用JAVASCRIPT判断FILE选中的文件大小?
- 页面停留两秒后自动转跳如何实现?
- 如何在 javascript 中 format 浮点型数值?
- 在javascript中,如何将含有双引号"单引号'空格 的字符串付给一个变量,见内
- 悬赏100分,各位大侠Javascript如何读取sql数据库的数据
- js文件调用html文件!大家帮帮忙啊,很急的!怎么修改javascript特效文本中的文本啊
- select名字中有.该怎么办?
<br>
<input type="button" value="click" onclick="foo()">
<script>
function foo(){
document.all('myBtn').outerHTML = '<input id="myBtn" type="text" value="See What is different">';
}
</script>
<script>
alert(b1.type);
</script>
<br>
<input type="button" value="click" onclick="foo()">
<script>
function foo(){
document.all('myBtn').outerHTML = '<input id="myBtn" type="button" value="See What is different">';
alert(b1.type);
}
</script>
------------------------试过了 还是出错:"对象不支持此属性与方法"
<br>
<input type="button" value="click" onclick="foo()">
<script>
function foo(){
document.all('myBtn').outerHTML = '<input id="myBtn" type="text" value="See What is different">';
}
</script>