J
J
Junior Development2019-12-15 21:48:46
Arrays
Junior Development, 2019-12-15 21:48:46

How to output certain array data based on value value in JS?

There is a trace. task:
When you click on the button (radio), information about the product should be displayed.
For example, let it be a title, a product description and an image.

<div class="wrapper">

    <!-- Панель кнопок -->
    <div class="panel buttons">

      <input class="button" name="tovar" type="radio" value="tovar1" id="but1">
      <label for="but1">товар 1</label>

      <input class="button" name="tovar" type="radio" value="tovar2" id="but2">
      <label for="but2">товар 2</label>

      <input class="button" name="tovar" type="radio" value="tovar3" id="but3">
      <label for="but3">товар 3</label>

    </div>
    <!-- End Панель кнопок -->

    <!-- Окно данных -->
    <div class="data-window">

      <div class="images"></div>

      <div class="coontent">

        <div class="title"></div>
        <div class="text"></div>

      </div>

    </div>
    <!-- End Окно данных -->

I assume that you need to display data from the array based on the value value.
Please tell me the options for solving the issue, given that I have very basic knowledge of JS.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question