主题:  层的innerHTML用法?

我知道

职务:普通成员
等级:4
金币:2.0
发贴:2211
注册:2002/2/8 13:02:46
#12002/3/13 10:57:34
层名.innerHTML=文本
这个文本不能换行吗?我写了老长的字符串,太不方便了!



风之翅

职务:普通成员
等级:2
金币:10.0
发贴:540
注册:2001/1/31 14:48:59
#22002/3/13 15:59:43
innerHTML里可以加HTML标签嘛!innerText才不行。。。



我知道

职务:普通成员
等级:4
金币:2.0
发贴:2211
注册:2002/2/8 13:02:46
#32002/3/14 13:14:04
jhsdx在上个帖子中说
引用:
innerHTML里可以加HTML标签嘛!innerText才不行。。。

我是说:
层名.innerHTML="
sjdflksdfjlsdk
"
只能这样写,而不能换行!
用什么方法可以这样写:
层名.innerHTML="




lsdjflskdf
"
啊?









5D限制级

职务:普通成员
等级:6
金币:10.0
发贴:4970
注册:2001/8/16 14:52:34
#42002/3/14 13:52:49


innerHtml支持HTML语句



我知道

职务:普通成员
等级:4
金币:2.0
发贴:2211
注册:2002/2/8 13:02:46
#52002/3/14 16:20:59
是吗?(.......狐疑的目光.......)



我知道

职务:普通成员
等级:4
金币:2.0
发贴:2211
注册:2002/2/8 13:02:46
#62002/3/14 16:21:35
不过我还要谢谢你!!!!!!!!!!!!



5D荣誉斑竹

职务:普通成员
等级:3
金币:10.0
发贴:1480
注册:2002/1/15 11:01:54
#72002/3/14 16:29:08
换行写法:
innerHTML=""
+""
+""
+""
+"
"
+"lsdjflskdf"
+"
"

连接字符串用+
居然
都回答出来了~



我知道

职务:普通成员
等级:4
金币:2.0
发贴:2211
注册:2002/2/8 13:02:46
#82002/3/15 9:25:20
deepdark在上个帖子中说
引用:
换行写法:
innerHTML=""
+""
+""
+""
+"
"
+"lsdjflskdf"
+"
"

连接字符串用+
居然
都回答出来了~


可行!
有更简单的方法吗?(哈哈!有点得寸进尺吧?)
我人比较懒!
游人告诉我innerTEXT 有用吗?



5DDreamweaver版主

职务:版主
等级:3
金币:10.0
发贴:1031
注册:2001/10/13 14:38:50
#92002/3/15 23:48:16
innerText

--------------------------------------------------------------------------------

Description

Sets or retrieves the text between the start and end tags of the current element.

Syntax
object.innerText[ = innerText]


Settings

This read-write property can be any valid string. When setting this property, the given string completely replaces the existing content of the element, except for , , and tags. <br><br>Note You cannot set this property while the document is loading. Wait for the onload event before attempting to set it. If a tag is dynamically created using TextRange, innerHTML, or outerHTML, you can only use JScript to create new events to handle the newly formed tags. VBScript is not supported.<br><br><B>innerHTML</B><br><br>--------------------------------------------------------------------------------<br><br>Description<br><br>Sets or retrieves the HTML between the start and end tags of the current element. <br><br>Syntax<br>object.innerHTML[ = innerHTML]<br><br><br>Settings<br><br>This read-write property takes a string containing a valid combination of text and HTML tags, except for <html>, <head>, and <title> tags. <br><br>When setting this property, the given string completely replaces the existing content of the element. If the string contains HTML tags, the string is parsed and formatted as it is placed into the document. <br><br>Note You cannot set this property while the document is loading. Wait for the onload event before attempting to set it. If a tag is dynamically created using TextRange, innerHTML, or outerHTML, you can only use JScript to create new events to handle the newly formed tags. VBScript is not supported.<br><br> </div> <div class='edit_last'> <p align="right"> <br /> </p> </div> <div class="qianming"></div> </div> </td> </tr> </table> <div id="ctl00_ctl00_main_main_Pager2" class="pages"><div class="quotes">每页显示15条 1/1<a disabled="true" class="disabled"> << </a><a disabled="true" class="disabled"><</a><span class="current">1</span><a disabled="true" class="disabled"> >> </a><input type="input" /><input type="button"/ value="GO" onclick="if(!isNaN(this.previousSibling.value))location.href='?forum=15&id=263156&page={0}'.replace('{0}',this.previousSibling.value)"></div></div> </div> </form> <script type="text/javascript"> $('a.delete').click(function(){ return confirm("删除后将不可还原,请再次确认"); }); var init_Script = function() { try { var o = GetContent(); o.style.width = '100%'; } catch (e) { } }; init_Script(); $('#aspnetForm').keyup(function(e) { if (e.ctrlKey && e.keyCode == 13) { $('#ctl00_ctl00_main_main_btnSubmit').click(); } }); </script> </div> <div id="footer"> <div class="logo"></div> <div class="right"> <div class="links"> <ul> <li><a href="#"><span>使用帮助</span></a></li> <li>|</li> <li><a href="#"><span>站务公告</span></a></li> <li>|</li> <li><a href="#"><span>咨询求助</span></a></li> <li>|</li> <li><a href="#"><span>个人申述</span></a></li> <li>|</li> <li><a href="#"><span>关于我们</span></a></li> <li>|</li> <li><a href="#"><span>免责声明</span></a></li> <li>|</li> <li><a href="#"><span>合作联系</span></a></li> <li>|</li> <li><a href="#"><span>版权信息</span></a></li> <li>|</li> <li><a href="#"><span>友情链接</span></a></li> <li>|</li> <li><a href="http://www.miibeian.gov.cn/CX/main.jsp" target="_blank"><span>ICP许可证:浙ICP备05007613号</span></a></li> </ul> <div class="top"> <a href="#container"><span>TOP</span></a> </div> </div> <div class="copyright"> ©5D.cn. 版权所有      </div> </div> </div> </div> </body> </html>