求高手解答:javascript的alert不能弹出窗口
<!doctypehtml><html><head><style>#div1{width:100px;height:100px;background:red;}</sty...
<!doctype html>
<html>
<head>
<style>
#div1{width:100px;height:100px;background: red;}
</style>
<meta charset="utf-8">
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function ()
{
var oDiv=document.getElementById('div1');
alert(oDiv.currentStyle.width);
}
</script>
</head>
<body>
<div id="div1">
</div>
</body>
</html>
在IE浏览器也不弹出窗口 展开
<html>
<head>
<style>
#div1{width:100px;height:100px;background: red;}
</style>
<meta charset="utf-8">
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function ()
{
var oDiv=document.getElementById('div1');
alert(oDiv.currentStyle.width);
}
</script>
</head>
<body>
<div id="div1">
</div>
</body>
</html>
在IE浏览器也不弹出窗口 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询