document.write怎么用? <span id="nowtime" title="testtitle">1</span><script>document.all.nowtime.innerHTML="<b>aa</b>";</script> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <span id="nowtime" title="testtitle">1</span><script>document.all.nowtime.innerText="1cb";</script> nowtime.innerHTML = 'x'; 有点文不对题嘛!<body><span id=nowtime></span><script>document.all.nowtime.innerText = 'x';</script>即可!你若问为什么,其实很简单。你必须保证document对象已经生成!!!! 为什么必须得<body>存在才行?我在页面内部写入的时候,<span>不是紧跟body的,而是在一个层里面的。结果就写入不了了。 document.all.nowtime.innerHTML能不能用? document.getElementById("nowtime").innerText='x';我不喜欢innerText,innerHTML,outerHTML等....Mozilla不支持.. InnerText指文本内容InnerHTML指代码document.getElementById("nowtime").innerText="<font color='#FF0000'></font>";document.getElementById("nowtime").innerHTML="<font color='#FF0000'></font>"; 如何用php实现无跳转的跨域上传? 推荐一个极好的WEB报表控件ATGrid,能在线看到效果 php函数问题 PHP tree php 中怎么能每秒都能运行一次函数? 关于section的倒序实现 PHP安装方式? 【简单】set_time_limit问题 在51.net的空间里如何实现用PHP实现上传文件? php变量问题 汉字问题? 怎么读mp3和wma的头信息啊?分不够再加
<script>
document.all.nowtime.innerText="1cb";
</script>
<body>
<span id=nowtime></span>
<script>
document.all.nowtime.innerText = 'x';
</script>
即可!
你若问为什么,其实很简单。你必须保证document对象已经生成!!!!
我在页面内部写入的时候,<span>不是紧跟body的,而是在一个层里面的。结果就写入不了了。
InnerHTML指代码document.getElementById("nowtime").innerText="<font color='#FF0000'></font>";
document.getElementById("nowtime").innerHTML="<font color='#FF0000'></font>";