亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

JavaScript入門篇

難度入門
時長 1小時35分
學習人數
綜合評分9.57
5511人評價 查看評價
9.8 內容實用
9.5 簡潔易懂
9.4 邏輯清晰
扯淡·吐槽
寫完函數事件后,不要忘了回到input表單,設置鼠標點擊事件onclick="函數名"
<input type="button" value="改變顏色" onclick="tp()">
<input type="button" value="改變寬高" onclick="whchange()" >
<input type="button" value="隱藏內容" onclick="hidetext()">
<input type="button" value="顯示內容" onclick="showtext()" >
//定義"取消設置"的函數
function replace(){
var mychar= document.getElementById("txt");
var message=confirm("確認取消")
if(message==true){
mychar.removeAttribute("style");}
}
//定義"隱藏內容"的函數
function hidetext()
{
var mychar= document.getElementById("txt");
mychar.style.display="none";
}
//定義"顯示內容"的函數
function showtext()
{
var mychar = document.getElementById("txt");
mychar.style.display="block";
}
//定義"改變顏色"的函數
function tp(){var mychar = document.getElementById("txt");
mychar.style.color="red";
mychar.style.style.backgroundColor="#CCC";}

//定義"改變寬高"的函數
function whchange(){
var mychar= document.getElementById("txt");
mychar.style.width="350px";
mychar.style.height="300px";}
function openWindow(){
var open=confirm("對話框是否點擊了確定")
if(open==true){
// 新窗口打開時彈出確認框,是否打開
window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,toolbar=no')
}
else
{
open.close();
}
}
我特想說一句 我不是歐巴。
<script type="text/javascript">
function add(){
var p1 = document.getElementById("p1");
document.write("one"+p1.className+"<br>");}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";}
</script>
<script type="text/javascript">
function hidetext(){
var mychar = document.getElementById("con");
mychar.style.display=none;}
function showtext()
{var mychar = document.getElementById("con");
mychar.style.display:block;}
</scrip>
<script type="text/javascript">
var mychar=document.getElementById("con");
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="Hello world!";
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
<script type="text/javascript">
function openWindow(){
var open=confirm("確認打開新窗口嗎?")
if(open=true)
{window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,toolbar=no');}
else{mywin.close();}
}
function openWindow()
var open=confirm("確認打開新窗口嗎?")
if(open=true)
{ window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,toolbar=no')}
else{mywin.close();}
var c1=document.getElementById("txt");
function changeColor(){
c1.style.backgroundColor="black";
c1.style.color="white";
}

function changeWH(){
c1.style.height="300px";
c1.style.width="200px";
}
function hide(){
c1.style.display="none";
}

function display1(){
c1.style.display="block";
}
function replace(){
if(confirm("是否取消設置")){
c1.removeAttribute("style");
}

}
課程須知
該課程是針對新手的一個簡單基礎的課程,讓您快速了解JS,通過一些簡單的代碼編寫體會JS。如果您已經對JS有所了解,可以跳過本課程,學習JS進階課程,進一步學習JS相應的基礎知識。學習本課程,希望您至少具備HTML/CSS基礎知識,認識常用的標簽。
老師告訴你能學到什么?
1. 理解JavaScript基礎語法; 2. 掌握常用語句的使用方法; 3. 學會如何獲取DOM元素及進行簡單操作。

微信掃碼,參與3人拼團

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網的支持!

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消