Reputation: 153
While using getElementById().getElementsByTagName()
it's not getting objects in IE8. For example:
var devang = getElementById('devang').getElementsByTagName('li');
alert(devang.length);
it's return length of objects, while in IE8 it's shows value 0;
Upvotes: 3
Views: 1949
Reputation: 26
another quick solution
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
above html5shive.min.js add in your header your code will be working nicely in internet explorer 8.
more details you can study on google code html5shiv
Upvotes: 1
Reputation: 5356
instead of this
var devang = document.getElementById('devang').getElementsByTagName('li');
Upvotes: 1