Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular call function on option select

<select id="selectid" class="form-control-mb-12" (change)="modo($event.target.value)">
   <option value="mod1">MODO 1</option>
   <option value="mod2">MODO 2</option>
   <option value="mod3">MODO 3</option>
</select>

modo(value: string){
  switch(value) {
    case "mod1":
       // if modo 1 is selected do something.
       break;
    case "mod2":
       // if modo 2 is selected do something.
       break;
    case "mod3":
       // if modo 3 is selected do something.
       break;
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: difference between devDependency and dependency 
Javascript :: convert a string to a number in javascript 
Javascript :: react router history push parameter 
Javascript :: click outside box jquery 
Javascript :: javascript delete first character from string 
Javascript :: javascript for loop infinite 
Javascript :: detect dark mode javascript 
Javascript :: javascript split string only on first instance of specified character 
Javascript :: javascript transpose rows to columns 
Javascript :: js cookies 
Javascript :: prime or not in javascript 
Javascript :: convert array to object in javascript 
Javascript :: PG::DuplicateTable: ERROR: relation already exists 
Javascript :: javascript animate elements 
Javascript :: jquery click outside 
Javascript :: redirect with react router v6 
Javascript :: set drain docker node 
Javascript :: javascript convert minutes to hh mm 
Javascript :: splidejs example 
Javascript :: react, scroll element into view 
Javascript :: alternate color to table row jquery 
Javascript :: mongoose update createdAt 
Javascript :: how to pretty formatjson value on terminal ruby 
Javascript :: count number of divs inside a div jquery 
Javascript :: how to convert to one decimal place javascript 
Javascript :: bash commands in node 
Javascript :: what is the use of angularjs 
Javascript :: react onclick div 
Javascript :: assign an element value as key in array of objects 
Javascript :: jquery validation phone number 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =