도조
Dojo는 JavaScript 언어로 구현 된 오픈 소스 DHTML 툴킷입니다. 여러 프로젝트 기부금 (Nwidgets, Burstlib, F (M))를 기반으로 구축되었으며, 이는 "Unified"툴킷이라고 불립니다. Dojo의 목표는 DHTML 애플리케이션을 개발할 때 DHTML의 오랜 역사적 문제를 해결하는 것입니다. 크로스 브라우저 문제.
1. 문제 배경
다음은 옵션이 일년 내내 있고 드롭 다운 상자의 값과 텍스트가 선택되는 드롭 다운 상자입니다.
2. 소스 코드를 구현하십시오
<! doctype html> <html> <head> <meta charset = "utf-8"/> <title> 드롭 다운 상자의 값과 텍스트를 get </title rel = "Stylesheet"href = "js/dojo/dijit/esses/claro/claro.css"/> <script = "text/javascrip" src = "js/jquery-1.12.4.js"> </script> <script type = "text/javaScript"src = "js/dojo/dojo/dojo.js"> </script> <tyle> #season {width : 200px; } </style> <cript> dojoconfig = {async : true, parseonload : true} </script> <cript> 요구 ([ "dojo/store/memory", "dijit/form/filteringselect", "dojo/domready!"], 함수 (Memory, FilteringsSelect) {new Memory ({name : ", ID : "Spring"}, {이름 : "Summer", Id : "Summer"}, {이름 : "Autumn", id : "Autumn", {이름 : "winter", id : "Winter"}}}); "계절"). startup (); </script> </head> <body> <입력 ID = "Season"/> <br> <button id = "valueBtn"onclick = "alert (dijit.byid ( 'season')). get ( 'value'))"> 드롭 다운 상자 값 </button> <button id = "textbtn"on click = "alert.byid ( 'get'). 드롭 다운 박스 텍스트 </button> </body> </html>3. 결과를 달성하십시오
(1) 초기화
(2) "드롭 다운 박스 값 가져 오기"버튼을 클릭하십시오
(3) "드롭 다운 박스 텍스트 가져 오기"버튼을 클릭하십시오