//定义"隐藏内容"的函数
function hidetext()
{
var mychar= document.getElementById("txt");
mychar.style.display="none";
}
//定义"显示内容"的函数
function showtext()
{
var mychar = document.getElementById("txt");
mychar.style.display="block";
}
function hidetext()
{
var mychar= document.getElementById("txt");
mychar.style.display="none";
}
//定义"显示内容"的函数
function showtext()
{
var mychar = document.getElementById("txt");
mychar.style.display="block";
}
//定义"改变颜色"的函数
function tp(){var mychar = document.getElementById("txt");
mychar.style.color="red";
mychar.style.style.backgroundColor="#CCC";}
//定义"改变宽高"的函数
function whchange(){
var mychar= document.getElementById("txt");
mychar.style.width="350px";
mychar.style.height="300px";}
function tp(){var mychar = document.getElementById("txt");
mychar.style.color="red";
mychar.style.style.backgroundColor="#CCC";}
//定义"改变宽高"的函数
function whchange(){
var mychar= document.getElementById("txt");
mychar.style.width="350px";
mychar.style.height="300px";}
已采纳回答 / ChinaMoker
<script type="text/javascript"> function openWindow(){ var open open=confirm("打开新窗口?") if(open=true) window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no') else open...
2015-08-03
已采纳回答 / Perona
花括号嵌套错乱了。<...code...>这里变量ope是不需要加引号的。后面的参数直接用一对单引号就可以了。修改后的代码你看看<...code...>
2015-08-02
<script type="text/javascript">
function add(){
var p1 = document.getElementById("p1");
document.write("one"+p1.className+"<br>");}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";}
</script>
function add(){
var p1 = document.getElementById("p1");
document.write("one"+p1.className+"<br>");}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";}
</script>
2015-08-02
<script type="text/javascript">
function hidetext(){
var mychar = document.getElementById("con");
mychar.style.display=none;}
function showtext()
{var mychar = document.getElementById("con");
mychar.style.display:block;}
</scrip>
function hidetext(){
var mychar = document.getElementById("con");
mychar.style.display=none;}
function showtext()
{var mychar = document.getElementById("con");
mychar.style.display:block;}
</scrip>
2015-08-02
<script type="text/javascript">
var mychar=document.getElementById("con");
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
var mychar=document.getElementById("con");
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
2015-08-02
<script type="text/javascript">
function openWindow(){
var open=confirm("确认打开新窗口吗?")
if(open=true)
{window.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no,toolbar=no');}
else{mywin.close();}
}
function openWindow(){
var open=confirm("确认打开新窗口吗?")
if(open=true)
{window.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no,toolbar=no');}
else{mywin.close();}
}