<script>
if(prompt('請輸入 我是狗')==='我是狗')
{
alert('你是狗')
}else{
for(i=1;i<1;i++){
alert('sb');
}
}
</script>
if(prompt('請輸入 我是狗')==='我是狗')
{
alert('你是狗')
}else{
for(i=1;i<1;i++){
alert('sb');
}
}
</script>
2016-07-05
高度還原代碼:
<script type="text/javascript">
if(prompt('輸入 我是狗')==='我是狗')
{
alert('你是狗');
}else{
for(i=1;i<1;i++)
alert('sb');
}
</script>
<script type="text/javascript">
if(prompt('輸入 我是狗')==='我是狗')
{
alert('你是狗');
}else{
for(i=1;i<1;i++)
alert('sb');
}
</script>
2016-07-05
樓上的幾個都特么亂發、、、window.open后面不加網址打開個屁吖、、、
function openWindow()
{
if(confirm("是否打開新頁面?"))
{
var url=prompt("請輸入網址","http://www.xianlaiwan.cn/")
window.open('http://www.xianlaiwan.cn','_blank','width=400','height=500','menubar=no','toolbar=no')
}
}
function openWindow()
{
if(confirm("是否打開新頁面?"))
{
var url=prompt("請輸入網址","http://www.xianlaiwan.cn/")
window.open('http://www.xianlaiwan.cn','_blank','width=400','height=500','menubar=no','toolbar=no')
}
}
object.className = classname 相當于更換類(class)名稱來改變樣式(style)
在以后復雜的代碼中可以根據這個輕松更換,更加清晰看出那里有變動
在以后復雜的代碼中可以根據這個輕松更換,更加清晰看出那里有變動
2016-07-05
function openWindow(){
if(confirm('確定?')){
var url = prompt('請輸入網址:',' http://www.xianlaiwan.cn/');
if(url!= null){
window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
if(confirm('確定?')){
var url = prompt('請輸入網址:',' http://www.xianlaiwan.cn/');
if(url!= null){
window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
function hidetext()
{
var mychar = document.getElementById("con");
mychar.style.display='none';
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display='block';
}
這樣比較好,把con后面引號去掉是寫成一行
{
var mychar = document.getElementById("con");
mychar.style.display='none';
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display='block';
}
這樣比較好,把con后面引號去掉是寫成一行
2016-07-04
function hidetext()
{
var mychar = document.getElementById("con")
.style.display='none';
}
function showtext()
{
var mychar = document.getElementById("con")
.style.display='block';
}
//('con')后面有;要去掉
{
var mychar = document.getElementById("con")
.style.display='none';
}
function showtext()
{
var mychar = document.getElementById("con")
.style.display='block';
}
//('con')后面有;要去掉
2016-07-04
mychar.style.color='red';
mychar.style.backgroundColor='#ccc';
mychar.style.width='300px';
mychar.style.backgroundColor='#ccc';
mychar.style.width='300px';
2016-07-04
<script>
document.write("hello");
document.getElementById("p1").style.color="blue";
document.getElementById("body").style.background="pink";
alert("你們這些逗逼玩的挺嗨啊");
</script>
document.write("hello");
document.getElementById("p1").style.color="blue";
document.getElementById("body").style.background="pink";
alert("你們這些逗逼玩的挺嗨啊");
</script>
2016-07-04