I have this code :
var tmp=$(this).attr('id').split("_");
and I'd like to store on tmp the second value after the split. So if $(this).attr('id') = "hello_marco" I'd like to store in tmp the value marco, not the array.
Of course, I want to do it directly in one line of code, without first store the array and the access to it with array[1].
Is it possible on JS/Jquery?
var tmp = $(this).attr('id').split("_")[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