I am very new to jQuery but learning. I am trying to do something simple (I think) but struggling. I am trying to add a var into Jquery to customise an specific element.
I need to add 'styler' class to my div which has the id="spinner7" like -
$('#spinner7').addClass('styler');
However the number can vary so I need to add it to the end of #spinner. I have tried things like below but no joy. Can anyone help please.
var ctrl = '7';
$('#spinner +ctrl').addClass('styler');