For dropdown options you probably want something like this:
var conceptName = $('#aioConceptName').find(":selected").text();
The reason val()
doesn’t do the trick is because clicking an option doesn’t change the value of the dropdown–it just adds the :selected
property to the selected option which is a child of the dropdown.
Related Contents:
- Avoid dropdown menu close on click inside
- How to use jQuery to select a dropdown option?
- Get text of the selected option with jQuery [duplicate]
- Print the contents of a DIV
- How to disable all div content
- In jQuery, how do I select an element by its name attribute?
- Why is it a bad practice to return generated HTML instead of JSON? Or is it?
- jQuery Mobile: document ready vs. page events
- jQuery: Get height of hidden element in jQuery
- How do I link a JavaScript file to a HTML file?
- Prevent browser from loading a drag-and-dropped file
- Setting href attribute at runtime
- horizontal scrollbar on top and bottom of table
- Cross-browser multi-line text overflow with ellipsis appended within a fixed width and height
- Make header and footer files to be included in multiple html pages
- Adding additional data to select options using jQuery
- Set date in input type date
- Javascript regex returning true.. then false.. then true.. etc [duplicate]
- How to submit an HTML form without redirection
- jQuery text() and newlines
- How can javascript upload a blob?
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Generic way to detect if html form is edited
- Best Practice to Organize Javascript Library & CSS Folder Structure [closed]
- how to pass this element to javascript onclick function and add a class to that clicked element
- How can I remove the “No file chosen” tooltip from a file input in Chrome?
- How to disable submit button once it has been clicked?
- How to get the onclick calling object?
- jQuery Array of all selected checkboxes (by class) [duplicate]
- Jquery, Clear / Empty all contents of tbody element?
- How to select ALL children (in any level) from a parent in jQuery?
- jQuery/JavaScript collision detection
- By event.target, how I know that it is checkbox or it is radio?
- JavaScript – head, body or jQuery?
- Can I bind form inputs to models in Backbone.js without manually tracking blur events?
- Using execCommand (Javascript) to copy hidden text to clipboard
- How to format/tidy/beautify in JavaScript
- Chrome Extension “Refused to load the script because it violates the following Content Security Policy directive”
- Preview images before upload
- Get textarea text with JavaScript or jQuery
- Count textarea characters
- Fire oninput event with jQuery
- How to get the innerHTML of selectable jquery element?
- How do I know which button is clicked when the bootstrap modal closes?
- Scrolling issues with multiple bootstrap modals
- How to close an open collapsed navbar when clicking outside of the navbar element in Bootstrap 3?
- How can I use JSON data to populate the options of a select box?
- How to use JQuery to select the nth option
- How do I call a JavaScript function after selecting a file from the Select File window and closing it?
- jquery submit form and then show results in an existing div