- Save data code:
<script>
$('[data-tag="emailmkt"]').on('submit',function(e){
var objEmail = {};
$($(this).find('input')).each(function(i,element){
if($(element).attr('name') == 'EMAIL'){
objEmail['EMAIL'] = $(element).val();
}
if($(element).attr('name') == 'FNAME'){
objEmail['FNAME'] = $(element).val();
}
})
localStorage.setItem('emailmkt',JSON.stringify(objEmail));
})
​​​​​​​
</script>