<script>
var error = document.querySelector('#result');
if (error.querySelector('.success, .error') != null) {
var type = error.querySelector('.success, .error').className;
console.log(type);
//$('#error').css("opacity","1").css("z-index","100000");
swal({
position: 'center',
type: type,
title: '<?php if ($this->error) echo $this->error; ?>',
showConfirmButton: false,
timer: 2500
})
</script>
var _a = document.querySelectorAll('.a'),
_b = document.querySelectorAll('.b');
function cc(a) {
console.log(a);
}
for(var i = 0; i < _a.length; i++){
_a[i].addEventListener('click', cc(_b[i]),false);
_b[i].addEventListener('click', cc(_b[i]), false);
}