Answers for "jquery make new variable with dynamic name"

0

jquery make new variable with dynamic name

var vars = {};
var newCount = 0;

$('.hello').click(function(){
    newCount++;
    vars['hello' + newCount] = '<p>Hello World</p>';
    console.log( JSON.stringify(vars) );
});
Posted by: Guest on September-28-2020

Code answers related to "jquery make new variable with dynamic name"

Code answers related to "Javascript"

Browse Popular Code Answers by Language