Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript categories input object example

    $('select').on('change', function () {
        var subcategories = '';
        var str = "This category contains these subcategories: ";
        var result = str.bold();

        switch (this.value) {
               case 'Category 1':
                subcategories = "Subcategory 1.1, Subcategory 1.2";
                break;
                
                case 'Category 2':
                subcategories = "Subcategory 2.1, Subcategory 2.2";
                break;
                
                case 'Category 3':
                subcategories = "Subcategory 3.1, Subcategory 3.2";
                break;
                
                case 'Category 4':
                subcategories = "Subcategory 4.1, Subcategory 4.2";
                break;
 
        }
        document.getElementById("showSubcategory").innerHTML = result + subcategories;
    });
Comment

PREVIOUS NEXT
Code Example
Javascript :: three movimiento js 
Javascript :: save browser password 
Javascript :: create-react-app height issues with flex 
Javascript :: window location host vs origin 
Javascript :: javascript promises mdn 
Javascript :: angular material slide effect button click 
Javascript :: jquery element by name 
Javascript :: alpine js x:bind href link 
Javascript :: mongoose-unique-validator 
Javascript :: How do you remove property name from this code? const foo = { name; “albert” }; 
Javascript :: filtering buttons parseint javascript 
Javascript :: local storage textarea 
Javascript :: how to replace import with require 
Javascript :: asasa 
Javascript :: javascript get distance bwetween elements 
Javascript :: ERROR in ./node_modules/pretty-format/node_modules/ansi-regex/index.js Module build failed: Error: ENOENT: no such file or directory 
Javascript :: hide show jquery 
Javascript :: sharepoint javascript get last added item 
Javascript :: descomponer un numero js 
Javascript :: on second click javascript 
Javascript :: change previous location history javascript 
Javascript :: html5 web component 
Javascript :: cara install parrot os di virtualbox 
Javascript :: how to make your own version of filter method 
Javascript :: js to ts converter 
Javascript :: get last day of month js 
Javascript :: How to Use the Return Keyword in a Function 
Javascript :: Star Wars Celebration 
Javascript :: qiankun angular 
Javascript :: Creatable Multiselect 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =