There is the following code:
$('#PROGRAMS .options > div').click(function(){ var pid = this.value; $('#group .options > div').each(function(index, elem){ console.log(pid); }); }); From the function in each() pid variable is not visible. How to send it there?
undefined, does thedivhave anyvalue? This code works fine right on this page $ ('. Question-body'). Click (function () {var pid = 123; $ ('. Question-body'). Each (function () {console.log ( pid);});}); - etkivar pid = this.getAttribute('value')- co11ter