I want to change the form's target based on the option which is selected.
<form id='post_form' target="targetvalue">
<select id="select" name="select">
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
</select>
    </form>
 <script>
 $("#select").change(function() {
    var targetvalue = $("#select option:selected").text();
    $("#post_form").attr("target", targetvalue);
    });
 </script>
 
     
     
    