最新回答 / 浮生若夢e
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" Content="text/html; charset=utf-8" /><title>javascript</title><style type="text/css">body{font-size:12px;}#txt{? ? height:400px;? ? width:600px; border:#3...
2020-06-05
<script type="text/javascript">
function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
2020-06-04
var mychar= document.getElementById("con");
mychar.style.color="white";
mychar.style.backgroundColor ="black";
mychar.style.width="1000px";
mychar.style.color="white";
mychar.style.backgroundColor ="black";
mychar.style.width="1000px";
2020-06-04
function openWindow(){
var mymessage=confirm("是否打開新窗口?");// 新窗口打開時彈出確認框,是否打開
if(mymessage==true)
{
window.open('http://idcbgp.cn','_blank','width=400,height=500,top=100,left=0,menubar=no,toolbar=no');
}
else
{
alert("滾犢子!");
}
}
var mymessage=confirm("是否打開新窗口?");// 新窗口打開時彈出確認框,是否打開
if(mymessage==true)
{
window.open('http://idcbgp.cn','_blank','width=400,height=500,top=100,left=0,menubar=no,toolbar=no');
}
else
{
alert("滾犢子!");
}
}
2020-06-04
function Wopen(){
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000,heigt=1000,top=100,left=0,menubar=no,toolbar=no, status=no,scrollbars=yes',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="親愛的請進來!" / >
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000,heigt=1000,top=100,left=0,menubar=no,toolbar=no, status=no,scrollbars=yes',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="親愛的請進來!" / >
2020-06-04
<script type="text/javascript">
function Wopen(){
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000','heigt=1000','top=100','left=0',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="親愛的請進來!" / >
function Wopen(){
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000','heigt=1000','top=100','left=0',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="親愛的請進來!" / >
2020-06-04
function rec(){
var mymessage=confirm("你是女士?"); ;
if(mymessage==true)
{
document.write("你是女士!");
}
else
{
document.write("你是男士!");
}
}
var mymessage=confirm("你是女士?"); ;
if(mymessage==true)
{
document.write("你是女士!");
}
else
{
document.write("你是男士!");
}
}
2020-06-04
<script type="text/javascript">
function rec(){
var mychar="I love JavaScript";
alert(mychar);
}
function rec(){
var mychar="I love JavaScript";
alert(mychar);
}
2020-06-04
<script type="text/javascript">
function contxt() //定義函數(shù)
{
alert("哈哈,調(diào)用函數(shù)了!");
}
contxt();
</script>
</head>
<body>
<form>
<input type="button" value="點擊我" onclick="contxt()" />
function contxt() //定義函數(shù)
{
alert("哈哈,調(diào)用函數(shù)了!");
}
contxt();
</script>
</head>
<body>
<form>
<input type="button" value="點擊我" onclick="contxt()" />
2020-06-04
已采納回答 / 沉默寡言黃少天丶
javaScript放在head和body的區(qū)別 ????在head中時,所代表的functions只加載而不執(zhí)行,執(zhí)行是在某一事件觸發(fā)后才開始。 ????在body中時,直接加載并執(zhí)行 典型的區(qū)別: ????如果有不在函數(shù)中的執(zhí)行語句,比如變量初始化,如果在head中就不會執(zhí)行。
2020-06-02