I have a JavaScript functionality that change the value dynamically on selecting a list box ,i am able to get that value in a text field using the id.But i want to get that value in a jsp variable that i am not able to get this is what i have done ,
<div class="form-control">
<label class="lebelMergin" for="_Manager">
<span class="spanMergin"></span>
<input type='text' class='text' name='business1' id="hiddenField" />
</label>
</div>
jquery
$('#branch_branchTypeId').on('change', function (event) {
//var vl = $("option:selected",this).text();
var vl = $(this).val();
var myvalue=$("option:selected",this).text();
$('.text').val(myvalue);
document.getElementById("hiddenField").value=myvalue;
var target = $("#business");
if (vl) {
target.show();
} else {
target.hide();
}
});
This is showing the value in the div using id.but i want that id in a script variable.