谁说查不到innerHTML方法?看看帮助:
ms-help://MS.VSCC/MS.MSDNVS.2052/DHTML/workshop/author/dhtml/reference/properties/innerHTML.htm
ms-help://MS.VSCC/MS.MSDNVS.2052/DHTML/workshop/author/dhtml/reference/properties/innerHTML.htm
解决方案 »
- spring.net事务怎么配置
- 关于在vs2008引入JQuery自动提示问题
- fileupload学习中的小问题
- webpart与updatepanel结合出现的问题
- 很奇怪的错,系统找不到指定文件.
- 为什么系统在xp服务器下一切正常,到了2003服务器下报js脚本错误?
- 各位了解三层的好心人。帮我指点一下我写的一个三层练手程序(Ajax交互,URL重写。XSL换肤)。写到后台就不敢写了。
- 关于图片格式的正则表达式
- ASP新手,问高手简单问题:背景图片如何保持静止?
- FormView+LinqDataSource的更新代码
- 请问怎样取得ButtonColumn事件的id值
- asp.net中关于时间的处理问题:
Scripting object.innerHTML [ = sHTML ] Possible ValuessHTML String that specifies or receives the content between the start and end tags. The property is read/write for all objects except the following, for which it is read-only: COL, COLGROUP, FRAMESET, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE, TR. 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.ResThe innerHTML property is valid for both block and inline elements. By definition, elements that do not have both an opening and closing tag cannot have an innerHTML property.The innerHTML property takes a string that specifies a valid combination of text and elements.When the innerHTML property is set, the given string completely replaces the existing content of the object. If the string contains HTML tags, the string is parsed and formatted as it is placed into the document.This property is accessible at run time, as of Microsoft® Internet Explorer 5. Removing elements at run time, before the closing tag is parsed, could prevent other areas of the document from rendering.When using innerHTML to insert script, you must include the DEFER attribute in the script element.You can change the value of the title element using the document.title property.To change the contents of the table, tFoot, tHead, and tr elements, use the table object model described in How to Build Tables Dynamically. For example, use the rowIndex property or the rows collection to retrieve a reference to a specific table row. You can add or delete rows using the insertRow and deleteRow methods. To retrieve a reference to a specific cell, use the cellIndex property or the cells collection. You can add or delete rows using the insertCell and deleteCell methods. To change the content of a particular cell, use the innerHTML property.To maintain compatibility with earlier versions of Internet Explorer, this property applies to the textArea object. However, the property works only with strings that do not contain tags. With a string that contains a tag, this property returns an error. It is better to use the innerText property with this object.ExamplesThis example uses the innerHTML property to change the text of a paragraph when an onmouseover event occurs. The affected text and any tags within it are changed by the onmouseover and onmouseout events....
<P onmouseover="this.innerHTML='<B>Mouse out to change back.</B>'"
onmouseout="this.innerHTML='<I>Mouse over again to change.</I>'">
<I>Mouse over this text to change it.</I>
</P>
...
Show Me
This example uses the innerHTML property to insert script into the page.Hide Example<HTML>
<SCRIPT>
function insertScript(){
var sHTML="<input type=button onclick=" + "go2()" + " value='Click Me'><BR>";
var sScript="<SCRIPT DEFER>";
sScript = sScript + "function go2(){ alert('Hello from inserted script.') }";
sScript = sScript + "</SCRIPT" + ">";
ScriptDiv.innerHTML = sHTML + sScript;
}
</SCRIPT>
<BODY onload="insertScript();">
<DIV ID="ScriptDiv"></DIV>
</BODY>
</HTML>