劉任昌HTML,CSS,JavaScript將執行結果放置網頁取代檔案

期中考重點

  • write寫入檔案模式mode w=write會覆蓋原有檔案, a=append接續原來檔案, x=create創立新檔案, x與w有何不同?
  • write寫入檔案,預設不換行,換行'\n'
  • print呈現在螢幕,預設換行,不換行end=''。
  • write寫入用到英文以外的字元(一,a,b)encoding='utf8'
  • 開一個資料資料夾放三個檔案html, css, js,用html文件document
  • 在html檔案指定css與js檔案,參考w3schools...都有寫

vs code的html檔案



劉任昌輸入參數

輸入k
輸入m
輸入n

重點

alert內建函數,自訂函數abc

劉任昌輸出結果

<link rel='stylesheet' href="abc.css">
<script src="abs.js"></script>
<h1>劉任昌輸入參數</h1>
輸入k<input type="number" value="1" id="k"></input><br>
輸入m<input type="number" value="1" id="m"></input><br>
輸入n<input type="number" value="1" id="n"></input><br>
<button onclick="abc()">執行自訂函數</button>
<h1>重點</h1>
alert內建函數,自訂函數abc
<h1>劉任昌輸出結果</h1>
<div id="out"></div>

vs code的css檔案

h1{background-color: purple; color: white; border: 10px solid red; text-align:center; padding: 5px}
ul{background-color: green; color: white; font-size: 2em;line-height:1.5}
input{font-size:24px;background-color:rgb(210, 250, 215);}

vs code的javascript檔案

function abc(){
k = document.getElementById('k').value;
m = document.getElementById('m').value;
n = document.getElementById('n').value;
out = k;
document.getElementById('out').innerHTML=out;
}

留言

  1. https://wilson11122.blogspot.com/2024/04/htmlcssjava-script.html

    回覆刪除
  2. https://addison030.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除
  3. https://kk0725.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除
  4. https://hui026.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除
  5. https://oscarliu1688.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除
  6. https://whitexd.blogspot.com/2024/04/html-css-javascript.html

    回覆刪除
  7. https://njcjww.blogspot.com/2024/04/htmlcssjavescript.html

    回覆刪除
  8. https://keiime.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除
  9. https://ctz642895.blogspot.com/2024/04/html-css-javascript.html

    回覆刪除
  10. https://htmlcssjavascriptjavapython.blogspot.com/2024/04/h1background-color-purple-color-white.html

    回覆刪除
  11. https://tustning.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除
  12. https://asd0908449304.blogspot.com/2024/04/htmlcssjavaspcript.html

    回覆刪除
  13. https://grace8166.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除
  14. https://xi715.blogspot.com/2024/04/htmlcssjavascript.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

柯聞折Javascript物件導向方法是物件的函數

甲劉任昌python串列List(陣列Array),元組Tuple,集合Set,字典Dict

劉任昌PYTHON陣列ARRAY串列LIST字典DIC集合SET元組TUPLE