I am trying to assign a value in jQuery to an input field with a variable name.
Basically I want to access inputs depending on the name of the input:
<script type="text/javascript">
$(document).ready(function () {
var inp = "input1";
$("input[name='my<%inp%>']").val('hoera');
});
</script>
But this does not work. Does anyone have an idea?
Try using