<select name="alb_id" id="select_id">
<option value="0">:: Selecione um álbum ::</option>
<option title="My first title" value="40">First</option>
<option title="My second title" value="41">Second</option>
<option title="My third title" value="59">Third</option>
</select>
<input type="submit" value="Alterar" id="btsend" name="send" class="btedit"/>
Ich versuche, den Wert, der im Titel Attribut der Auswahl ist, aber ich kann nur den aktuellen Wert auswählen. Weiß jemand, wie man das löst? Verwenden Sie diesen Code unten:Wie erhalte ich den aktuellen Wert des title-Attributs in einem Select?
$("#btsend").click(function (e) {
var get_val = $("#select_id").val($(this).find("option:selected").attr("title"));
$("#new_value").val(get_val); //$new_value: I want to here the value of the selected option's title
});
nicht. Wenn ich sehe, dass Ihr Code unvollständig ist. – Karra
Es funktioniert ganz sicher. http://jsfiddle.net/jfeltis/9zkJZ/ – Joe