Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get selected option value jquery

$("#vacc_wellness_agegroups option:selected").val();
Comment

get option value jquery

<select id="state">
    <option value="state1" data-id="1">state1</option>
    <option value="state2" data-id="2">state2</option>
    <option value="state3" data-id="3">state3</option>
</select>

$('#state option[data-id="2"]').val();

//output state2
Comment

select selected value jquery

If you want to get the selected option text, you can use $(select element). text() . var text = $('#aioConceptName option:selected'). text();
If you want to get selected option value, you can use $(select element). val() . var val = $('#aioConceptName option:selected').val();
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to restrict page leave in javascript 
Javascript :: how to trigger on Blur only when clicked outside parent component and not child component in react js 
Javascript :: jquery return normal element 
Javascript :: jquery timeout 
Javascript :: material ui css supports 
Javascript :: js get current top position event listeners 
Javascript :: AjaxGet 
Javascript :: enum in javascript es6 
Javascript :: 419 Unknown status, csrf token required, ajax csrf setup 
Javascript :: javascript is a compiled language 
Javascript :: browser console noting displayed 
Javascript :: aws lambda create 
Javascript :: nodejs s3 read 
Javascript :: extending classes javascript 
Javascript :: read pdf as array bytes using fetch 
Javascript :: jquery add submit button dynamically to form 
Javascript :: get latest journal entry without html 
Javascript :: __v:0 in my data mongoose 
Javascript :: on second click javascript 
Javascript :: exit from jshell 
Javascript :: javascript interview quetions 
Javascript :: redux cannot read properties state) = state.useSelector 
Javascript :: Old Syntax of Router Switch 
Javascript :: when i add data into the input it disappeared in react 
Javascript :: all ways pass data to onather page in javascript 
Javascript :: remove package-lock.json from commit 
Javascript :: Joining two arrays with lookup 
Javascript :: react extends component App.defaultProps 
Javascript :: Return object in parenthesis to avoid it being considered a wrapping function body 
Javascript :: onPlay 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =