Ciao,
Ho due select, riferendomi alla prima idTendinaduel vorrei sostitire l'id idTendinaduel... di var selectValue = $(#idTendinaduel, 'option:selected').val; ... con lavariabile selectId, come posso fare?
Grazie
<select id="idTendinaduel" class="form-control">
<option value="0">Select Value 0</option>
<option value="8">Option value 8</option>
<option value="5">Option value 5</option>
<option value="4">Option value 4</option>
</select>
<select id="idTendinagoonies" class="form-control">
<option value="0">Select Value 1</option>
<option value="8">Option value 7</option>
<option value="5">Option value 2</option>
<option value="4">Option value 3</option>
</select>
questo serve? https://jsfiddle.net/Adrenerg1co/vr7phz35/5/#&togetherjs=S2k8CmrUCt
<input type="text" id="textFieldTextJQ" class="form-control"
placeholder="get value on option select">
$("#idTendinaduel").on("change",function(){
//Getting Value
var selectId = $("select").attr("id");
var selectValue = $(selectId, 'option:selected').text;
// var selValue = $("'#' + optionId :selected").text();
alert(selectValue);
var selectValue1 = $(this).children(":selected").text();
alert(selectValue);
//Setting Value
$("#textFieldTextJQ").val(selectValue);
alert(selectValue);
$('#test').attr('id')
});