-4

i'm have some values to fill in the text box. In input text box. It contains multidimensional array so how can i set value using jquery.

    <input 
        type="text"
        id="kvtabform1-1-score" 
        class="form-control" 
        name="kvTabForm1[1][Score]" 
        autocomplete="off"/>
Shubham Jain
  • 930
  • 1
  • 14
  • 24
Santhosh
  • 1
  • 1

1 Answers1

0

Using starts with selector

$('[name^="kvTabForm1"]').each(function() {
    $(this).val('hello')
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" id="kvtabform1-1-score" class="form-control" name="kvTabForm1[1][Score]" autocomplete="off">
Monica Acha
  • 1,076
  • 9
  • 16