Getting a typeerror whilst trying to create a currency exchange selector
Hi,
I'm trying to create a currency exchange selector like the one on the below site:
I've written the below jquery which is runs when the currecy drop down is changed and is supposed to loop through and convert all the currencies:
- $('.currencySelector').change(function() {
-
- var currency = self.val();
-
-
- $( ".curreny" ).each(function( index ) {
-
- var total = self.attr('euro-total');
-
-
- switch(currency) {
- case 'eur':
- self.html(total);
- break;
- case 'gbp':
- self.html(total*0.72);
- break;
-
- case 'usd':
- self.html(total*1.10);
- break;
- }
-
-
- });
-
- });
But I'm getting the below error:
Uncaught TypeError: self.val is not a function
Any help would be greatly appreciated, I'm fairly new to jQuery.
Thanks,