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

阅读:6391回复:5
2005-04-12 12:24
写私信
楼主#
非常急,请版主指教
2005-04-12 12:24
写私信
1楼#
还有,使用innerHTML动态改变表单域后提交表单得不到表单域的值,在IE中宮.
有没有人知道啊
2005-04-12 12:24
写私信
3楼#
想其它办法吧

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
2005-04-12 12:24
写私信
4楼#
<div><p id="a">1234</p></div>
<button onclick="alert(a.parentNode.innerHTML)">test</button>
2005-04-12 12:24
写私信
5楼#
我的需求是这样的
动态取得标签中的文本
如<td id=td1><a href="a.htm">aaaaa</a></td>
因为TD标签中的内容是动态的。页面中还有一组单行按钮,当我选择一个单选按钮时,要重写TD中的内容,并且要在选回原来按钮时再恢复。所以我要用outerHTML取回原来的文本先保存起来。