读书人

哪位高手帮小弟我解决一下js标签中获得

发布时间: 2013-12-15 22:17:19 作者: rapoo

谁帮我解决一下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的时候 是个标签 ,会报错。
[解决办法]
浏览器调试看看 很清楚。

读书人网 >JavaScript

热点推荐