5月15日上課筆記-js中 location對象的屬性、document對象、js內建對象、Date事件對象、

來源:互聯網
上載者:User

標籤:get   second   下拉框   多個   string   out   html   根據   and   

location的屬性:    host: 返回當前主機名稱和連接埠號碼定時函數:    setTimeout( )    setInterval()    二、document對象    getElementById();      根據ID值擷取一個DOM對象      getElementsByName();   根據name屬性值擷取多個Dom對象    getElementsByTagName(); 根據標籤擷取多個DOM對象        擷取標籤體內容  innerHTML    擷取input的value值   value    擷取下拉框選中的值 value    this 代表當前對象    總結:innerHTML和value既可以擷取也可以修改三、js內建對象    Array:用於在單獨的變數名中儲存一系列的值    String:用於支援對字串的處理    Math:用於執行常用的數學任務,它包含了若干個數字常量和函數    Date:用於操作日期和時間        Date對象:        var today = new Date();        //年份:        var year = today.getFullYear();        //月份        var month = today.getMonth() + 1;        //日期        var day = today.getDate();        //時        var hour = today.getHours();        //分        var minute = today.getMinutes();        //秒        var seconds = today.getSeconds();    Math對象:        random(); 隨機數        rand();   四捨五入

 

5月15日上課筆記-js中 location對象的屬性、document對象、js內建對象、Date事件對象、

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.