function openWindow(){
var myconfirm = confirm("確定打開新窗口嗎?");
if(myconfirm==true)
{
var address ;
address = prompt("請輸入網址:","http://www.xianlaiwan.cn/");
window.open(address,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
var myconfirm = confirm("確定打開新窗口嗎?");
if(myconfirm==true)
{
var address ;
address = prompt("請輸入網址:","http://www.xianlaiwan.cn/");
window.open(address,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
var mychar= document.getElementById("con");
mychar.style.color="red";
mychar.style.backgroundColor="grey";
mychar.style.width="300px";
mychar.style.color="red";
mychar.style.backgroundColor="grey";
mychar.style.width="300px";
2015-07-24
var idVal=document.getElementById("txt");
//改變顏色,其余重復參考左側提示
function upcolor(){
idVal.style.color="red";
}
隱藏內容
function hide()
{
idVal.style.display="none";
}
取消設置
function cancel(){
var a= confirm("取消設置?");
if(a==true){
idVal.setAttribute('style','');
}
}
input里用onclick="函數名"屬性調用函數
//改變顏色,其余重復參考左側提示
function upcolor(){
idVal.style.color="red";
}
隱藏內容
function hide()
{
idVal.style.display="none";
}
取消設置
function cancel(){
var a= confirm("取消設置?");
if(a==true){
idVal.setAttribute('style','');
}
}
input里用onclick="函數名"屬性調用函數
<script type="text/javascript">
function contxt() //定義函數
{
alert("哈哈,調用函數了!");
}
</script>
</head>
<body>
<form>
<input type="button" value="點擊我" onclick="contxt" />
</form>
</body>
</html>
然后就錯了
function contxt() //定義函數
{
alert("哈哈,調用函數了!");
}
</script>
</head>
<body>
<form>
<input type="button" value="點擊我" onclick="contxt" />
</form>
</body>
</html>
然后就錯了
2015-07-23
var mychar= document.getElementById("con");
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
2015-07-23