title: How to change the selected option of a drop down box on clicking a particular div using jquery?
body: <p>I have a drop down menu with options 'text,text area,drop down ,email' etc. I also have a list of links like text ,text area etc. When I click these link,the corresponding html element is created. i.e, if I click text,  a text box is created. And if I click text area,a text area is created. </p>
  
  <p>Now I want the option selected in the drop down box to be updated to the value of the link I have selected, i.e., if I select drop down, the option to be selected in the drop down box must be 'Drop Down' .How can I do this?</p>
  
  <p>Here's my drop down box:</p>
  
  <pre><code>&lt;p class="fieldTitle" style="display: none;" &gt;Field Type:&lt;/p&gt;
  &lt;div id="selectFieldType"&gt;
      &lt;select id="fieldType"  style="display: none;"&gt;
          &lt;option id="Text" value="Text" selected="selected" &gt;Text&lt;/option&gt;
          &lt;option id="Textarea" value="Textarea"&gt;Text Area&lt;/option&gt;
          &lt;option id="Dropdown" value="Dropdown"  &gt;Drop Down&lt;/option&gt;
          &lt;option id="Radio" value="Radio"&gt;Multiple Choices&lt;/option&gt;
  
      &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is the links that I have. On clicking this I generate that particular form element. I also want the option in the dropdown box to be updated to that form element name.</p>
  
  <pre><code>&lt;div id="fb_contentarea_col1down"&gt;
  
     &lt;h6 class="page_heading"&gt;Common Fields:&lt;/h6&gt;
      &lt;ul class="formfield"&gt;
          &lt;li&gt;&lt;a href="#" id="text"&gt;Text&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#" id="textarea"&gt;Textarea&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#" id="dropdown"&gt;Dropdown&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#" id="radio"&gt;Multiple Choices&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Jquery function</p>
  
  <pre><code> $('#fb_contentarea_col1 a').click(function() {  
  
      fieldType=$(this).attr("id");
      $("#fieldType option[value='" + fieldType + "']").attr ( 'selected' , 'selected' );
  
   });
  </code></pre>