|
|
主题: 层的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=" " 只能这样写,而不能换行! 用什么方法可以这样写: 层名.innerHTML=" " 啊?
|
 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.
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.
innerHTML
--------------------------------------------------------------------------------
Description
Sets or retrieves the HTML between the start and end tags of the current element.
Syntax object.innerHTML[ = innerHTML]
Settings
This read-write property takes a string containing a valid combination of text and HTML tags, except for , , and tags.
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.
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.
|