everywhen
小狐狸
小狐狸
  • UID5020
  • 注册日期2005-04-12
  • 最后登录2005-04-13
  • 发帖数4
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:6371回复:5

FIREFOX中要实现document.getElementById('redispos').outerHTML怎么办?

楼主#
更多 发布于:2005-04-12 12:24
非常急,请版主指教
everywhen
小狐狸
小狐狸
  • UID5020
  • 注册日期2005-04-12
  • 最后登录2005-04-13
  • 发帖数4
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
1楼#
发布于:2005-04-12 12:24
还有,使用innerHTML动态改变表单域后提交表单得不到表单域的值,在IE中宮.
有没有人知道啊
猫头猪
狐狸大王
狐狸大王
  • UID163
  • 注册日期2004-11-25
  • 最后登录2005-12-04
  • 发帖数595
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
2楼#
发布于:2005-04-12 12:24
不能用innerHTML么?
guoshuang
火狐狸
火狐狸
  • UID771
  • 注册日期2004-12-11
  • 最后登录2006-12-28
  • 发帖数134
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
3楼#
发布于:2005-04-12 12:24
想其它办法吧

The following element properties (originally from Internet Explorer) are likewise not supported in the W3C  Document Object Model:

    * element.innerText
    * element.outerText
    * element.outerHTML

Scripts that use these properties will not execute in Firefox, Mozilla and Netscape 6/7 or other standards-compliant browsers. Instead, use the W3C DOM access attributes and access methods described in the next section; since these are supported by Internet Explorer too, then there is no need to use MSIE-specific attributes and methods.

来自:
http://www.mozilla.org/docs/web-develop ... ade_2.html
guoshuang
火狐狸
火狐狸
  • UID771
  • 注册日期2004-12-11
  • 最后登录2006-12-28
  • 发帖数134
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
4楼#
发布于:2005-04-12 12:24
<div><p id="a">1234</p></div>
<button onclick="alert(a.parentNode.innerHTML)">test</button>
everywhen
小狐狸
小狐狸
  • UID5020
  • 注册日期2005-04-12
  • 最后登录2005-04-13
  • 发帖数4
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
5楼#
发布于:2005-04-12 12:24
我的需求是这样的
动态取得标签中的文本
如<td id=td1><a href="a.htm">aaaaa</a></td>
因为TD标签中的内容是动态的。页面中还有一组单行按钮,当我选择一个单选按钮时,要重写TD中的内容,并且要在选回原来按钮时再恢复。所以我要用outerHTML取回原来的文本先保存起来。
游客

返回顶部