function openWindow()
{
if(confirm("是否打开") == true)
{
window.open(prompt("打开的网址", "http://www.imooc.com/"), '_blank', 'width=400, height=500,menubar=no, toolbar=no')
}
}
{
if(confirm("是否打开") == true)
{
window.open(prompt("打开的网址", "http://www.imooc.com/"), '_blank', 'width=400, height=500,menubar=no, toolbar=no')
}
}
已采纳回答 / 慕粉3674908
var是用来申明mychar这个变量的。申明变量后,就可以用mychar存储document.getElementById("con");返回的html元素。之后,通过mychar变量就可以操作这个html元素了。
2016-07-16
最赞回答 / 要做Java大师
head和body都不是会自动换行和自动空格的标签,但是html默认出现在标签中的格式中存在的换行符和空格,如果不是自动换行的那类标签(比如<p>),都只给保留一个空格,所以检查一下标签和标签间的换行符就可以啦。
2016-07-16
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p id="a">I will achieve my dream!</p>
<script type="text/javascript">
var g=document.getElementById('a');
document.write(g);
</script>
</body>
</html>g获取的是整个P的元素,在页面上显示为[object HTMLParagraphElement],即p元素的返回值,若要我们显示p元素的内容,还是要加上innerHTML来显示,这样就有2句话了
<head>
<meta charset="utf-8">
</head>
<body>
<p id="a">I will achieve my dream!</p>
<script type="text/javascript">
var g=document.getElementById('a');
document.write(g);
</script>
</body>
</html>g获取的是整个P的元素,在页面上显示为[object HTMLParagraphElement],即p元素的返回值,若要我们显示p元素的内容,还是要加上innerHTML来显示,这样就有2句话了
2016-07-16
function qx(){
var qx = document.getElementById("txt");
var x=confirm("是否取消设置");
if(x){
qx.style.color = "";
qx.style.backgroundColor = "";
qx.style.width = "";
qx.style.height = "";
qx.style.display = "none";
qx.style.display = "block";
}
var qx = document.getElementById("txt");
var x=confirm("是否取消设置");
if(x){
qx.style.color = "";
qx.style.backgroundColor = "";
qx.style.width = "";
qx.style.height = "";
qx.style.display = "none";
qx.style.display = "block";
}