@jc_si 說的對,我開始沒打//,結果一輸入就出新窗口,反復好幾次直到輸完才停了。。。
2016-01-19
<script type="text/javascript">
var mychar= document.getElementById("con") ;
var mychar1=mychar.firstChild.nodeValue;
document.write("結果:"+mychar1); //輸出獲取的P標簽。
</script>
這樣改一下結果就對了
var mychar= document.getElementById("con") ;
var mychar1=mychar.firstChild.nodeValue;
document.write("結果:"+mychar1); //輸出獲取的P標簽。
</script>
這樣改一下結果就對了
2016-01-18
mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display="block";
}
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display="block";
}
2016-01-17
function context(){
alert("哈哈,函數調用了")
}
<form>
<input type="button" value="點擊我" onclick="contxt()"/>
</form>
alert("哈哈,函數調用了")
}
<form>
<input type="button" value="點擊我" onclick="contxt()"/>
</form>
2016-01-17
function openWindow(){
var message = confirm("是否打開?");
if(message == true){
var url = prompt("請輸入網址","http://www.xianlaiwan.cn");
if(url != null){
window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
}
var message = confirm("是否打開?");
if(message == true){
var url = prompt("請輸入網址","http://www.xianlaiwan.cn");
if(url != null){
window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
}
function Wopen(){
window.open('http://www.xianlaiwan.cn','_blank','width=400,height=400,top=100,left=0');
}
window.open('http://www.xianlaiwan.cn','_blank','width=400,height=400,top=100,left=0');
}
2016-01-17
p1.className='one';
p2.className='two';
p2.className='two';
2016-01-17
function add(){
var p1 = document.getElementById("p1");
p1.className='one';
}
function modify(){
var p2 = document.getElementById("p2");
p2.className='two';
}
var p1 = document.getElementById("p1");
p1.className='one';
}
function modify(){
var p2 = document.getElementById("p2");
p2.className='two';
}
2016-01-17