L
L
LordPrimes2018-03-25 12:09:47
JavaScript
LordPrimes, 2018-03-25 12:09:47

How to get the values ​​of multiple values?

Hello, I wrote this code

$('.column_sort').click(function (){
        let column_name = $(this).attr('id');
        let text = $(this).attr("alt");
          let category = $(".category-tovar").data('cater');
             $(".select-sort").text(text);
        let order = $(this).data('order'); 
   
         $.ajax({
       url:"temp/category.php",
       method:"POST",
       data:{column_name:column_name,order:order,category:category},
       success:function(data){
         
           $(".blocktovar").html(data); 
       }
       });
    });

I had difficulties in this place. I can’t figure out how to write a code that takes the values ​​​​of all IDs and not just one, if it’s not difficult for anyone, tell me how to do this. let category = $(".category-tovar").data('cater');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LordPrimes, 2018-03-25
@LordPrimes

I solved the issue myself. I wrote the let category variable to take on the values ​​of another variable that reads the IDs :) everything worked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question