var className = "order_enc_YUluWTo6ODA4OTczNjQ3MjAzOTc0OA%3D%3D"; $('input:checkbox.' + className).each(function() { (this.checked ? arr.push($(this).val()) : ""); });tener un nombre de clase encriptado pero al intentar ejecutar el bucle se obtiene un error Error no detectado: error de sintaxis, expresión no reconocida: entrada: checkbox.order_enc_YUluWTo6ODA4OTczNjQ3MjAzOTc0OA%3D%3D
probé comillas dobles simples pero sin éxito.
Prueba de esta manera
<input type="checkbox" class="order_enc_YUluWTo6ODA4OTczNjQ3MjAzOTc0OA%3D%3D" value="true"> var className = "order_enc_YUluWTo6ODA4OTczNjQ3MjAzOTc0OA%3D%3D"; $('input:checkbox[class="'+className+'"]').each(function() { (this.checked ? arr.push($(this).val()) : ""); }); // Connect in HTML file the src for the CryptoJs Lib /* <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"> </script> */ let className = "order_enc_YUluWTo6ODA4OTczNjQ3MjAzOTc0OA%3D%3D"; let decrypt = CryptoJS.AES.decrypt(className,'Secure className'); let decryptToString = decrypt.toString(CryptoJS.enc.Utf8); $('input' + decryptToString).each(function() { ($(this).checked ? arr.push($(this).val()) : ""); console.log($(this).val()) });