Need help selecting muiltiple div id's in jquery -


i trying select multiple id's using jquery. following code wrote not working.

var cat = $('.option_category').each(function() {   var cat_id = cat.attr('id');   console.log(cat_id'); }); }); 

this should resolve issues.

var cat = $('.option_category').each(function(){     var cat_id = $(this).attr('id');     console.log(cat_id); }); 

as aside, id attribute identification. not know implementation, however, if trying pass data through id, value parameter of option tag or data attributes.

https://developer.mozilla.org/en-us/docs/web/guide/html/using_data_attributes


Comments

Popular posts from this blog

python - Referencing Data From a 2D Histogram -

php - MySQL LIMIT results with INNER JOIN with more than 2 tables -

c# - Derived UserControl layout resets after build -