How would I go about removing the first character from this.className in the below line? The first variable will be _ and then a number. I just want the number to be assigned to className.
className = this.className;
Furthermore I am changing "$('.inter').html(window[link[className]]);"
to use an array instead of the className variable. Is the below code the correct way to use an array with the index as a variable?
$('.inter').html(window[link[className]]);
No need to use jQuery for that, just plain ol' javascript using .substring
var trimmed = this.className.substring(1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With