Select change (not with "$(this).attr('value'))" but to trigger execution of another function - jQuery
<p>I want trigger execution of another function from select change.</p>

<p>I want to trigger execution of updateFormats(); How to do this in jQuery?</p>

<pre><code>$('#inproj').change(function(){
            updateFormats();
                });

$('#outproj').change(function(){
            updateFormats();
        });
</code></pre>

<p>The code below works for changing the value of all select. However, I want the inproj and outproj select to trigger the execution of updateFormats() mentioned above.</p>

<pre><code>$("select").change(function () {
        var str = "";
        $("select option:selected").each(function () {
          str += $(this).text() + " ";
                      });
                    $("div").text(str);
                      })
                     .change();
</code></pre>

<p>The HTML of select inproj and outproj (jquery-mobile);</p>

<pre><code>    &lt;div data-role="fieldcontain"&gt;
     &lt;label for="inproj" class="select"&gt;Input Projection:&lt;/label&gt;
   &lt;select name ="inproj" id="inproj"&gt;
       &lt;option value="EPSG:4326" selected="selected"&gt;EPSG:4326&lt;/option&gt;
       &lt;option value="EPSG:900913"&gt;Spherical Mercator&lt;/option&gt;
    &lt;/select&gt; &lt;br /&gt;
  &lt;/div&gt;

        &lt;div data-role="fieldcontain"&gt;
         &lt;label for="outroj" class="select"&gt;Output Projection:&lt;/label&gt;
       &lt;select name="outproj" id="outproj"&gt;
      &lt;option value="EPSG:4326" selected="selected"&gt;EPSG:4326&lt;/option&gt;
      &lt;option value="EPSG:900913"&gt;Spherical Mercator&lt;/option&gt;
    &lt;/select&gt; 
    &lt;br /&gt;
        &lt;/div&gt;
</code></pre>

<p>The updateFormats() function.</p>

<pre><code>$(function() {
  function updateFormats() {
            var in_options = {
                'internalProjection': map.baseLayer.projection,
                'externalProjection': new OpenLayers.Projection(OpenLayers.Util.getElement("inproj").value)
            };   
            var out_options = {
                'internalProjection': map.baseLayer.projection,
                'externalProjection': new OpenLayers.Projection(OpenLayers.Util.getElement("outproj").value)
            };
            var gmlOptions = {
                featureType: "feature",
                featureNS: "http://example.com/feature"
            };
            var gmlOptionsIn = OpenLayers.Util.extend(
                OpenLayers.Util.extend({}, gmlOptions),
                in_options
            );
            var gmlOptionsOut = OpenLayers.Util.extend(
                OpenLayers.Util.extend({}, gmlOptions),
                out_options
            );

            var kmlOptionsIn = OpenLayers.Util.extend(
                {extractStyles: true}, in_options);
            formats = {
              'in': {
                wkt: new OpenLayers.Format.WKT(in_options),
                geojson: new OpenLayers.Format.GeoJSON(in_options),
                georss: new OpenLayers.Format.GeoRSS(in_options),
                gml2: new OpenLayers.Format.GML.v2(gmlOptionsIn),
                gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),
                kml: new OpenLayers.Format.KML(kmlOptionsIn),
                atom: new OpenLayers.Format.Atom(in_options)
              }, 
              'out': {
                wkt: new OpenLayers.Format.WKT(out_options),
                geojson: new OpenLayers.Format.GeoJSON(out_options),
                georss: new OpenLayers.Format.GeoRSS(out_options),
                gml2: new OpenLayers.Format.GML.v2(gmlOptionsOut),
                gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),
                kml: new OpenLayers.Format.KML(out_options),
                atom: new OpenLayers.Format.Atom(out_options)
              } 
            };
        }
      });  
  });
});
</code></pre>
