-2

Buttons minus and plus in input :http://www.bootply.com/ZnFpCtZhOa

<div class="xxx" data-name="quantity" data-value="2" data-id="80"></div>

how can i get value from div tag?

YWX
  • 33
  • 5

2 Answers2

0

Try

$('.xxx').change(function(){
  alert($(".xxx input").val());
        });

add separate class for each spinner

or This is best solution for you

$('.xxx').change(function(){
  alert($(this).find( "input" ).val());
        });

I hope this is what you are looking for

ganesh satpute
  • 391
  • 2
  • 10
0

You can use .attr() method in JQuery.

$('div').filter(function(){
alert($(this).attr('data-name'));
});

Js fiddle Demo : Click here

Rajeesh Menoth
  • 1,704
  • 3
  • 17
  • 33