Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript prevent value change in select option

old_value = $('#select :selected').val();
$('#select').change(function() {
  if($(this).val() == 'option 3') {//your specific condition
     $('#select').val(old_value);
  } else {
    old_value = $('#select :selected').val();
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: react if event.target is input 
Javascript :: React social login button 
Javascript :: good javascript ide 
Javascript :: javascript export 
Javascript :: angular mat radio group select index 
Javascript :: tag name javascript 
Javascript :: js split string 
Javascript :: javascript execute function after async 
Javascript :: sails disable grunt 
Javascript :: js range similar to python 
Javascript :: sort object with certain value at start of array js 
Javascript :: react native modal ios landscape 
Javascript :: test each jest 
Javascript :: Material-ui add box icon 
Javascript :: mongoose populate example 
Javascript :: check if user is streaming discord js 
Javascript :: jsx not working in react vscode 
Javascript :: apollo uselazyquery oncompleted 
Javascript :: angular dropdown selected value 
Javascript :: get max number in array 
Javascript :: factorial bigger than 170 javascript 
Javascript :: angular turn text into input 
Javascript :: jq click with trigger load data 
Javascript :: js store function in variable 
Javascript :: jsfuck 
Javascript :: webdriver-manager node known as a command 
Javascript :: javascript push 
Javascript :: postfix date javascript 
Javascript :: set to array casting js 
Javascript :: form data to json 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =