劉任昌for迴圈,自訂函數,使用alert內建函數

w3schools截圖

學習心得與內容

嚴格說,HTML/CSS僅是標記語言,不是程式語言,因為不能執行迴圈LOOP、判斷、輸入參數等功能。

劉任昌JavaScript For Loop迴圈

教學影片

以上原始程式碼

<style>h1{border:solid red 10px; background-color: purple; color: white;padding:10px; text-align: center; border-radius:20px}
  P{FONT-SIZE:30PT;background-image: linear-gradient(to right, red,orange,yellow,green,blue,indigo,violet);line-height:1.2; color: white;}</style>
<script>
function pig(){
t = ""; /*劉任昌宣告變數等於空字元,雙迴圈*/
for (var i = 1 ; i < 9; i ++){
   for (var j = 0; j <= i; j=j+2)
     t += j;  
   t += "<br>";}
   document.getElementById("cat").innerHTML = t;}
function hog(){
text = "";
for (let i = 128512; i < 128560; i++) {
  text += "&#"+i + ";"}
document.getElementById("demo").innerHTML = text;}
</script>
<h1>w3schools截圖</h1>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ-S5dbBpGV1McFWodnqzCVfmlKQZqxZmXmS56emKrN0p3_3QVzY2cK6WOQqj0ysmzF7HSQdLh7L8fn_U7IkLthCRh9PLDS3wNKyz8RgwFIHR5eDfePYWJmX7FaWzncl6fHgI8Kb37GM06Sd38446fvb8bCdaGGzBlfVo9nRHzvwU8oKWJ64aes0vAR2E/s1600/%E6%93%B7%E5%8F%96.PNG" style="display: block; padding: 1em 0px; text-align: center;"><img alt="" border="0" data-original-height="665" data-original-width="1635" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ-S5dbBpGV1McFWodnqzCVfmlKQZqxZmXmS56emKrN0p3_3QVzY2cK6WOQqj0ysmzF7HSQdLh7L8fn_U7IkLthCRh9PLDS3wNKyz8RgwFIHR5eDfePYWJmX7FaWzncl6fHgI8Kb37GM06Sd38446fvb8bCdaGGzBlfVo9nRHzvwU8oKWJ64aes0vAR2E/s1600/%E6%93%B7%E5%8F%96.PNG" /></a></div>
<h1>學習心得與內容</h1>
嚴格說,HTML/CSS僅是標記語言,不是程式語言,因為不能執行迴圈LOOP、判斷、輸入參數等功能。
<button onclick="pig()">執行我的函數</button>
<p id="cat"></p>
<h2>劉任昌JavaScript For Loop迴圈</h2>
<button onclick="alert('靠杯!')">執行內建函數</button>
<button onclick="hog()">執行自訂函數</button>
<p id="demo"></p>
<h1>教學影片</h1>
<iframe width="560" height="315" src="https://www.youtube.com/embed/9_JdWftT4g8?si=l4u3L5Ovcy-S5fU7" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

留言

  1. 作者已經移除這則留言。

    回覆刪除
  2. https://kitty030994.blogspot.com/2023/10/foralert_1.html

    回覆刪除
  3. 作者已經移除這則留言。

    回覆刪除
  4. https://wilson11122.blogspot.com/2023/10/pfont-size30ptbackground-image-linear.html

    回覆刪除
  5. https://whitexd.blogspot.com/2023/10/foralert.html

    回覆刪除
  6. https://rrrrr-eeeee.blogspot.com/2023/10/pfont-size30ptbackground-image-linear.html

    回覆刪除
  7. 作者已經移除這則留言。

    回覆刪除
  8. https://www.blogger.com/blog/post/edit/preview/7698579018900065546/1199250762172945097

    回覆刪除
  9. 作者已經移除這則留言。

    回覆刪除
  10. https://president-kp.blogspot.com/2023/10/foralert.html

    回覆刪除
  11. https://cindy650092.blogspot.com/2023/10/foralert.html

    回覆刪除
  12. https://grace8166.blogspot.com/2023/10/foralert.html

    回覆刪除
  13. https://www.blogger.com/blog/post/edit/preview/3090141429803304882/6600071783804582430

    回覆刪除
  14. https://amyxl6316.blogspot.com/2023/10/foralert.html

    回覆刪除
  15. https://keiime.blogspot.com/2023/10/pfont-size30ptbackground-image-linear.html

    回覆刪除
  16. https://yun0205.blogspot.com/2023/10/pfont-size30ptbackground-image-linear.html

    回覆刪除
  17. https://lawrence655064.blogspot.com/2023/10/pfont-size30ptbackground-image-linear_1.html

    回覆刪除
  18. https://hui026.blogspot.com/2023/10/foralert.html

    回覆刪除
  19. https://asd0908449304.blogspot.com/2023/10/foralert.html

    回覆刪除
  20. https://oscarliu1688.blogspot.com/2023/10/pfont-size30ptbackground-image-linear.html

    回覆刪除
  21. https://rainhtmlcssjavascriptjavapython.blogspot.com/2023/10/for.html

    回覆刪除
  22. https://ctz642895.blogspot.com/2023/10/blog-post.html

    回覆刪除
  23. https://tustning.blogspot.com/2023/10/p-font-size30pt-background-image-linear.html

    回覆刪除
  24. https://kk0725.blogspot.com/2023/10/foralert.html

    回覆刪除
  25. https://htmlcssjavascriptjavapython.blogspot.com/2023/10/foralert.html

    回覆刪除
  26. https://xi715.blogspot.com/p/blog-page_2.html

    回覆刪除
  27. https://jduwy67fhkfcf4135.blogspot.com/p/h1bordersolid-red-10px-background-color.html

    回覆刪除
  28. https://draft.blogger.com/blog/post/edit/2193891179544580221/2643665160806655670

    回覆刪除
  29. 作者已經移除這則留言。

    回覆刪除
  30. https://the-dumbest-one.blogspot.com/2023/10/alert.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

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

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

周偉玲Python執行IRR