Idea: 1. obtain the year, month, and day of the current date. capture the selected status 3. the drop-down list and content can be used to summarize the communication knowledge points: 1) datesnewDate (). getDate () // get the current date 2) yearnewDate (). getFullYear () // get the current year 3) opti... syntaxHighlighter
Ideas:
1. Get the year, month, and day of the current date
2. Capture the selected status
3. drop-down and content for communication
Knowledge Point summary:
1) dates = new Date (). getDate () // obtain the current Date
2) year = new Date (). getFullYear () // obtain the current year
3) option: contains (x) // indicates to find the option containing the text containing x in the option array.
4) attr ("x", "y ")
// Adds an attribute named x and the attribute value is y.
5) val () // obtain the value of the value Attribute of the current element
6) $ ('option: selected', this) // indicates that the selected option element is selected in the current selector (this). You can use option: selected)
7) $ ("x"). each (function () {...}) // indicates that the x selector traverses from 0 until the index of the last element of the x selector.
8) show () // display
9) hide () // hide
Come from xixifeng.com
By Xi Feng (StellaAh)
[Complete example]
[Html]
JQuery selects the drop-down switch content and displays the Content Based on the date | Come from xixifeng.com