bind function to newly created element
<p>Thanks for any help.</p>

<p>I have a function. Inside this function, I create two buttons and assign two ids. </p>

<pre><code>var content =

'&lt;div&gt;

'&lt;div id="stationPopUpbtn"&gt;' +
        '&lt;button id="createWave_updateStation" onclick="updateStationContent('+feature+')"&gt;Änderungen speichern&lt;/button&gt;'+
        '&lt;button id="createWave_deleteStation" onclick="deleteFeature('+feature+')"&gt;Station löschen&lt;/button&gt;'+
    '&lt;/div&gt;'+

'&lt;/div&gt;';
</code></pre>

<p>later in the same function I want to do:</p>

<pre><code>$('#_updateStation').bind('click', function(){ // stuff });
</code></pre>

<p>But it doesn't work. The content is added as part of a popup (OpenLayers) which in return is added to the map..</p>

<pre><code>            var popup = new OpenLayers.Popup.FramedCloud(
                feature.id+"_popup",
                feature.geometry.getBounds().getCenterLonLat(),
                new OpenLayers.Size(250, 100),
                content,
                null,   // anchor
                true,   // closeBox exists
                //closeBoxCallback
                function(){
                    feature.style.pointRadius = 20;
                    map.removePopup(feature.popup);
                }
            );
</code></pre>

<p>EDIT:</p>

<pre><code>$(document).append(content);
//map.addControl(selectControl);
//selectControl.activate();
$(document).on('click', '#createWave_updateStation' ,function(){
    console.log("TES");
});
    $('#create_stationPopup').popup('open');
</code></pre>
