You need to find the selected option:
$(this).find(':selected').data('id')
or
$(this).find(':selected').attr('data-id')
although the first method is preferred.
More Related Contents:
- How to get a cross-origin resource sharing (CORS) post request working
- Why is jQuery’s .ajax() method not sending my session cookie?
- Check if Internet Connection Exists with jQuery? [duplicate]
- Insert text into textarea with jQuery
- How to scroll up or down the page to an anchor using jQuery?
- How to add click event to a iframe with JQuery
- jQuery disable SELECT options based on Radio selected (Need support for all browsers)
- How to trigger an event after using event.preventDefault()
- jQuery Scroll To bottom of the page
- jquery click doesn’t work on ajax generated content
- is there an api in jqgrid to add advanced filters to post data?
- Modify HTTP Headers for a JSONP request
- slideToggle in table row
- How do I get the entire page’s HTML with jQuery?
- jQuery :contains selector to search for multiple strings
- jQuery add image inside of div tag
- Twitter Bootstrap Collapse plugin Direction—Horizontal instead of Vertical
- How to Delete Session Cookie?
- How to chain ajax calls using jquery
- Resizable table columns with jQuery [closed]
- How do I modify serialized form data in jQuery?
- Getting Error: Object doesn’t support property or method ‘assign’
- jQuery UI – Draggable is not a function?
- Bottle Py: Enabling CORS for jQuery AJAX requests
- SVG draggable using JQuery and Jquery-svg
- How can I hide divs if they are empty?
- Jquery validation not working with ckeditor
- how do you add an image to a jquery tooltip
- Jquery Multiple load in a DIV
- Get the selected option id with jQuery