---
title: "IE和Firefox的Javascript兼容性总结"
author: "uule"
date: "2011-07-08T11:07:49Z"
tags: []
categories: ["Web前端"]
slug: "ie-firefox-javascript"
draft: false
lastmod: "2011-07-08T16:36:52Z"
id: 1119451
url: "https://uule.iteye.com/blog/1119451"
---

```
if(document.all){
    cityname_div = document.getElementById("city_name_div").innerText;
}else{
    cityname_div = document.getElementById("city_name_div").textContent;
}
```

 

 

[http://www.cnblogs.com/wiky/archive/2010/01/09/IE-and-Firefox-Javascript-compatibility.html](http://www.cnblogs.com/wiky/archive/2010/01/09/IE-and-Firefox-Javascript-compatibility.html)

 

[http://www.cnblogs.com/dwjaissk/archive/2006/04/01/364329.html](http://www.cnblogs.com/dwjaissk/archive/2006/04/01/364329.html)