直接修改form元素的action属性
document.all("form的ID").action = "";
document.all("XXX")可以取得ID或name为XXX的元素包括form
取得了form元素后直接改Action属性就行了
.action = "新的连接";
document.all("form的ID").action = "";
document.all("XXX")可以取得ID或name为XXX的元素包括form
取得了form元素后直接改Action属性就行了
.action = "新的连接";
document.forms['yourFormsName'].action = 'your destination';
document.all["form的ID"].Attributes.item["action"] = "XXXXXXXX";
为了兼容性:(这方面我没注意太多完全是用DHTML DOM的格式来写的 W3C标准)
document.forms["form的ID"].Attributes.item["action"] = "XXXXXXXX";
document.all["form的ID"].setAttribute("action","XXXXXXXX");
无法设置属性值
document.forms["form的ID"].Attributes.item["action"];
输出显示为对象??
document.forms["form的ID"].Attributes.item["action"].value = "XXXXXXXXX";说明:
attributes的item方法item Method
--------------------------------------------------------------------------------Retrieves an attribute for an element from the attributes collection.SyntaxoItem = attributes.item(vIndex)ParametersvIndex Required. "Integer" or "String" that specifies the attribute. If this parameter is an integer, it is the zero-based index of the attribute in the attributes collection. If this parameter is a string, the attribute whose name matches the string is retrieved.
参数可以是整数或字符串 如果是整数则以0为基数的索引位置 如果是字符串则是item的名称Return Value
Returns an attribute if successful, otherwise null.
返回值
返回一个属性
attribute的 value属性value Property --------------------------------------------------------------------------------Sets or retrieves the value of the object.Syntaxattribute.value(v) [ = sValue ]
Possible ValuessValue String that specifies or receives the value. The property is read/write. The property has no default value.Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.