Solved

How to select the drop down using jquery

Posted on 2016-08-09
1
56 Views
Last Modified: 2016-08-13
HI,
In my html page i have created a drop down with the following :

<div class="form-group">
            <select id="mode" class="form-control">
              <option id="text/plain" selected>Rich Text</option>
              <option id="text/plain">Mark Down</option>
            </select>
      </div>


By default Rich Text is selected.
I want to select Mark Down using jquery. How can i do it ?
Thanks
0
Comment
Question by:Rohit Bajaj
1 Comment
 
LVL 12

Accepted Solution

by:
funwithdotnet earned 500 total points
ID: 41749480
Maybe:

$('#mode').val('Mark Down').change();

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question