蔡淑貞計算機

蔡淑貞學習Bro code製作計算機

disply的vlue用eval(display.value)

disply的vlue用eval(display.value)取代,算是「字串」運算結果 eval()內建函數(方法) in-line線內設定樣式 唯讀 read only

https://www.youtube.com/watch?v=I5kj-YsmWjM

Build this JS calculator in 15 minutes!

心得與考試重點

  1. LIST條例,UL=UNORDERED LIST,OL=ORDERED LIST,BUTTON按鈕,CLICK按下,ONCLICK事件
  2. 網頁的命令大小寫都可以
  3. <button onclick=="clearDisplay()">刪</button>
  4. SCRIPT區段有三個自訂的函數
    1. function appendToDisplay(input) { const display = document.getElementById("display"); display.value += input;}
    2. function clearDisplay() { const display = document.getElementById("display"); display.value = "";}
    3. function calculate() { const display = document.getElementById("display"); try{ display.value = eval(display.value); } catch(error){display.value = "Error";} }
  5. 在STYLE區段定義.MY{BACKGROUND-COLOR: LIGHTBLUE;}可以用在網頁的CLASS='MY'元件 徘徊
  6. CSS上製造滑鼠在上面就會改片樣式HOVER同義字excurse, hesitate, hover, linger, potter, roam
  7. BUTTON:HOVER滑鼠在上面,BUTTON:ACTIVE按下滑鼠
  8. 元件ELEMENT按鈕放在一個容器CONTAINER內,容器是在一個DIV=DIVISION內

心得與考試重點

HOVER滑鼠飛到上HOVER翱翔 ACTIVE

留言

  1. 1223.分常傑出,萬分優秀,你是文明世界的明燈!https://djhdvdhd.blogspot.com/2024/12/blog-post_22.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

蔡淑貞python,tkinter,Entry建構輸入工具,pop移除串列元素

蔡淑貞Javascript與Python數值方法