cancel
Showing results for 
Search instead for 
Did you mean: 

Magento getting option numbers with jquery

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Magento getting option numbers with jquery

hello,

 

I  have 3 different drop down menues and I want to have access to this menues with

JQuery.

 

Like this:

jQuery('#options_XX_text').on('input', function(e)

{
         var data1 = jQuery("#options_XX_text").val();

})

 

XX is an int number

 

How do I get now the right number for "options_XX_text" ?

 

thanks for helping

 

1 REPLY 1

Re: Magento getting option numbers with jquery

@RBeng Did you get XX int number inside your file? If XX is getting then you need to pass dynamic value inside your function,

var XX = 'dynamic option value';
jQuery('#options_'+XX+'_text').on('input', function(e)
{
var data1 = jQuery('#options_'+XX+'_text').val();
})
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial