var mychar= document.getElementById("con"); ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="hello world"
document.write("修改后的标题:"+mychar.innerHTML);
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="hello world"
document.write("修改后的标题:"+mychar.innerHTML);
2016-03-04
最新回答 / zczzhang
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>JS代码的位置</title><script type="text/javascript"> document.write("I Love") 这段是不是打错了,如果字母打错了也输出不了哦你要是错了就会到倒过来你...
2016-03-04
function onpenWindow(){
confirm("是否打开新窗口");
if(confirm()==true){
prompt("确认打开的网址"," http://www.imooc.com/");
if(prompt()==true){
window.open("prompt.value","_blank,","width=400,height=500,menubar-no,toolbar=no")
}
}
}
confirm("是否打开新窗口");
if(confirm()==true){
prompt("确认打开的网址"," http://www.imooc.com/");
if(prompt()==true){
window.open("prompt.value","_blank,","width=400,height=500,menubar-no,toolbar=no")
}
}
}
已采纳回答 / 重晚情
第一个输出的原来的内容,第二个输出的修改后的内容,直接对mychar.innerHTML进行的改动,然后再次输出,这两个document本身的功能一样,只是输出的内容不一样
2016-03-04
<script type="text/javescript">
function hidetext(){
varchar=document.getElementById("con");
mychar.style.display="none";
}
function showtext(){
var mychar=document.getElementById("con");
mychar.style.display="block";
}
</script>
function hidetext(){
varchar=document.getElementById("con");
mychar.style.display="none";
}
function showtext(){
var mychar=document.getElementById("con");
mychar.style.display="block";
}
</script>
2016-03-04
<script type="text/javascript">
var mychar="hello world!";
document.getElementById("mychar");
document.write("原标题是"+mychar);
mychar.innerHTML="new text";
document.write("修改后为"+mychar);
</script>
var mychar="hello world!";
document.getElementById("mychar");
document.write("原标题是"+mychar);
mychar.innerHTML="new text";
document.write("修改后为"+mychar);
</script>
2016-03-04
function openWindow()
{var warning=confirm("是否填写信息");
if(warning==true)
{var add=prompt("输入网址","http://www.imooc.com/");
if(add!=null)
{window.open(add,'_blank','width=400,height=500,menuber=no,toolbar=no');}
else{alert("什么都没有哦")}}
else{alert("已取消");}
{var warning=confirm("是否填写信息");
if(warning==true)
{var add=prompt("输入网址","http://www.imooc.com/");
if(add!=null)
{window.open(add,'_blank','width=400,height=500,menuber=no,toolbar=no');}
else{alert("什么都没有哦")}}
else{alert("已取消");}
prompt("需要提问的问题!",“可修改的答案!”);//这是一个提问的文本输入确认框!
2016-03-03
最新回答 / 隆先生
<input type="button" value="改变颜色" onclick="a()"/> <input type="button" value="改变宽高" onclick="b()"> <input type="button" value="隐藏内容" onclick="c()"> <input type="button" value="显示内容" onclick="d()"> <input type="...
2016-03-03
//定义"取消设置"的函数
var cancle = function(){
if(confirm("是否确定?")){
document.getElementById("txt").removeAttribute("style");
}
}
var cancle = function(){
if(confirm("是否确定?")){
document.getElementById("txt").removeAttribute("style");
}
}