哪位高手帮小弟我解决一下js标签中获得数据再显示的有关问题。小弟我自己写的代码。老是出错

谁帮我解决一下js标签中获得数据再显示的问题。我自己写的代码。老是出错。
var tmpnum;
var html02;
if(document.getElementById("newcount").outerHTML){
   html02 = document.getElementById("newcount").outerHTML;}
else{
html02 = document.getElementById("newcount").innerHTML;}
//document.getElementById("newcount001").innerHTML="当前第"+html02+"页";
tmpnum=parseInt(html02);
document.write(tmpnum);

------解决方案--------------------
你吧html02   alert 一下 。

parseInt 这个方法要传数字 。

走IF的时候 是个标签 ,会报错。
------解决方案--------------------
浏览器调试看看 很清楚。