Hi Everybody,
I have a problem with getElementsByTagName(‘!’) in Firefox. I have used the below code to show DOCTYPE tags found in the web page. Which is working fine for IE but not working in Firefox. Please tell me what function i need to use to get the <!> tags with in the page. Why the following code not working in firefox ?
function showDocType(){
docTagArray=document.getElementsByTagName(“*”);
alert(“docTagArray.length———–>” +docTagArray.length);
if(docTagArray.length>0){
for(i=0;i<docTagArray.length;i++){
s=new String(docTagArray[i].text).toUpperCase();
if(s.indexOf(‘XML’)!=-1){
if(docTagArray.length>1){
alert(docTagArray[i+1].text);
break;
}
else{
alert(docTagArray[i].text);
break;
}
}//end if
if(s.indexOf(‘DOCTYPE’)!=-1){
alert(docTagArray[i].text);
break;
}//end if
}//end for-loop
}//end if
else{
alert(‘DOCTYPE is Not Available for this Page!’);
}//end else
Thanks in Advance,
Prasad