Difference between revisions of "Demo homepage"

From evidyaloka
Jump to: navigation, search
Line 8: Line 8:
 
<htmltag tagname="script" type="javascript">
 
<htmltag tagname="script" type="javascript">
 
var dropDown = new OO.ui.DropdownWidget( {
 
var dropDown = new OO.ui.DropdownWidget( {
label: 'Dropdown menu: Select one option',
+
label: 'Select Subject',
// The menu is composed within the DropdownWidget
+
                menu: {
menu: {
+
 
items: [
 
items: [
 
new OO.ui.MenuOptionWidget( {
 
new OO.ui.MenuOptionWidget( {
data: 'a',
+
data: 'English',
label: 'First'
+
label: 'English'
 
} ),
 
} ),
new OO.ui.MenuOptionWidget( {
+
                                new OO.ui.MenuOptionWidget( {
data: 'b',
+
data: 'Science',
label: 'Second (disabled option)',
+
label: 'Science'
disabled: true
+
 
} ),
 
} ),
+
                                new OO.ui.MenuOptionWidget( {
+
data: 'Maths',
+
label: 'Maths'
]
+
} ),
}
+
                            ]
} ),
+
    }
 
+
                                } ),
// Trigger an event when an item in the menu is selected.
+
itemSelected = function(){
itemSelected = function(){
+
 
console.log( 'item selected' );
 
console.log( 'item selected' );
 
};
 
};
  
// Append the menu to the DOM.
 
 
$( document.body ).append( dropDown.$element );
 
$( document.body ).append( dropDown.$element );
  
 
dropDown.getMenu().on('select', itemSelected);
 
dropDown.getMenu().on('select', itemSelected);
 +
 
</htmltag>
 
</htmltag>

Revision as of 06:45, 22 December 2022

Evidyaloka Welcomes you!!