首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2013-12-15 
谁帮我解决一下js标签中获得数据再显示的问题。我自己写的代码。老是出错。var tmpnumvar html02if(documen

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

热点排行