Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dynamic select option dropdown in jquery

var temp = "myValue";

// Create New Option.
var newOption = $('<option>');
newOption.attr('value', temp).text(temp);

// Append that to the DropDownList.
$('#dptcentres_edit').append(newOption);

// Select the Option.
$("#dptcentres_edit > [value=" + temp + "]").attr("selected", "true");
Comment

PREVIOUS NEXT
Code Example
Javascript :: uncheck a checkbox in javascript 
Javascript :: how to map objects in react native 
Javascript :: how to add two attay into object in javascript 
Javascript :: dayofweek javascript 
Javascript :: javascript reverse loop 
Javascript :: sequelize dialect 
Javascript :: how to get id of current element clicked 
Javascript :: vscode react auto import 
Javascript :: socket io close client connection 
Javascript :: window.location.search get parameters react 
Javascript :: comments in json 
Javascript :: webpack react proxy not working 
Javascript :: Rename files in a directory with node.js 
Javascript :: moment check greater than current time 
Javascript :: call javascript function use array 
Javascript :: alert and prompt in javascript 
Javascript :: javascript check if string contains character 
Javascript :: regular expression special characters 
Javascript :: javascript on keypu 
Javascript :: promise in forloop 
Javascript :: useScreens() react native 
Javascript :: ajax form picture upload 
Javascript :: chartjs line color 
Javascript :: Javascript Regex for non-negative numbers 
Javascript :: javascript regex replace 
Javascript :: object key map javascript 
Javascript :: find in string javascript 
Javascript :: js enum 
Javascript :: What is data modeling in MongoDB 
Javascript :: how to debug jest test vscode 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =