function hidetext()
{
var mychar = document.getElementById("con").style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
{
var mychar = document.getElementById("con").style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
2016-03-27
<script type="text/javascript">
function add(){
var p1 = document.getElementById("p1");
p1.className="one"
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="one"
}
</script>
function add(){
var p1 = document.getElementById("p1");
p1.className="one"
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="one"
}
</script>
2016-03-27
function Wopen(){
var xinbox=confirm("是否新建窗口?");
var ttcaa=prompt("請輸入網址","http://www.xianlaiwan.cn");
if(xinbox==true&&ttcaa=="http://www.xianlaiwan.cn"){
window.open(ttcaa,'_blank','width=600,height=500,left=100,top=100')
}
else{
alert("你沒有打開窗口!")
document.write("你為啥不打開慕課網?")
}
}
var xinbox=confirm("是否新建窗口?");
var ttcaa=prompt("請輸入網址","http://www.xianlaiwan.cn");
if(xinbox==true&&ttcaa=="http://www.xianlaiwan.cn"){
window.open(ttcaa,'_blank','width=600,height=500,left=100,top=100')
}
else{
alert("你沒有打開窗口!")
document.write("你為啥不打開慕課網?")
}
}
2016-03-27
function Wopen(){
var xinbox=confirm("是否新建窗口?")
if(xinbox==true){
var ttcaa=prompt("請輸入網址","http://www.xianlaiwan.cn")
window.open(ttcaa,'_blank','width=600,height=500,left=100,top=100')
}
else{
alert("你沒有打開窗口!")
document.write("你為啥不打開窗口?")
}
var xinbox=confirm("是否新建窗口?")
if(xinbox==true){
var ttcaa=prompt("請輸入網址","http://www.xianlaiwan.cn")
window.open(ttcaa,'_blank','width=600,height=500,left=100,top=100')
}
else{
alert("你沒有打開窗口!")
document.write("你為啥不打開窗口?")
}
2016-03-27
function 函數名()
{
函數代碼;
}
說明:
1. function定義函數的關鍵字。
2. "函數名"你為函數取的名字。
3. "函數代碼"替換為完成特定功能的代碼。
完成function函數后一定要記得調用函數,否則不出現結果。
{
函數代碼;
}
說明:
1. function定義函數的關鍵字。
2. "函數名"你為函數取的名字。
3. "函數代碼"替換為完成特定功能的代碼。
完成function函數后一定要記得調用函數,否則不出現結果。
2016-03-27
function rec(){
var score; //score變量,用來存儲用戶輸入的成績值。
score = prompt("請輸入你的基情值!");
if(score>=90)
{
document.write("你很棒!");
}
else if(score>=75)
{
document.write("不錯吆!");
}
else if(score>=60)
{
document.write("要加油!");
}
else
{
document.write("要努力了!");
}
}
var score; //score變量,用來存儲用戶輸入的成績值。
score = prompt("請輸入你的基情值!");
if(score>=90)
{
document.write("你很棒!");
}
else if(score>=75)
{
document.write("不錯吆!");
}
else if(score>=60)
{
document.write("要加油!");
}
else
{
document.write("要努力了!");
}
}
2016-03-27
<script type="text/javascript">
function openWindow(){
var my=confirm("是否打開新的網頁")
if (my==true)
{
window.open('http://www.xianlaiwan.cn','_blank','width=500,height=500,menuber=no,toolbar=no,');
}
else
{
window.close;
}
function openWindow(){
var my=confirm("是否打開新的網頁")
if (my==true)
{
window.open('http://www.xianlaiwan.cn','_blank','width=500,height=500,menuber=no,toolbar=no,');
}
else
{
window.close;
}
innerHTML 屬性用于獲取或替換 HTML 元素的內容。
語法:
Object.innerHTML
注意:
1.Object是獲取的元素對象,如通過document.getElementById("ID")獲取的元素。
2.注意書寫,innerHTML區分大小寫。
語法:
Object.innerHTML
注意:
1.Object是獲取的元素對象,如通過document.getElementById("ID")獲取的元素。
2.注意書寫,innerHTML區分大小寫。
2016-03-27