如何在Firefox中做OuterHTML? [英] How do I do OuterHTML in firefox?

查看:87
本文介绍了如何在Firefox中做OuterHTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码的一部分我获得了OuterHTML属性

 < LI onclick =TabClicked(this,'SearchName' ,'TabGroup1');>名称

,所以我可以做包含解析它的东西。 / p>

但是在firefox的javascript中没有OuterHTML属性,我找不到另一种方法来获取这个字符串。想法?

解决方案

想出来!

 code> child.getAttributeNode(OnClick)。nodeValue; 

getAttribute没有工作,但getAttributeNode工作得很好; D


Part of my code I get the OuterHTML propery

"<LI onclick="TabClicked(this, 'SearchName', 'TabGroup1');">Name "

so I can do stuff involing parsing it.

There is no OuterHTML property in javascript on firefox though and I can't find an alternative way to get this string. Ideas?

解决方案

Figured it out!

child.getAttributeNode("OnClick").nodeValue;

getAttribute didn't work, but getAttributeNode worked great ;D

这篇关于如何在Firefox中做OuterHTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆