Getting a typeerror whilst trying to create a currency exchange selector

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:

  1. $('.currencySelector').change(function() {
  2.   
  3. var currency = self.val();

  4. $( ".curreny" ).each(function( index ) {
  5.   
  6. var total = self.attr('euro-total');

  7. switch(currency) {
  8.    case 'eur':
  9.        self.html(total);
  10.        break;
  11.    case 'gbp':
  12.     self.html(total*0.72);
  13.        break;

  14. case 'usd':
  15. self.html(total*1.10);
  16.        break;
  17. }
  18. });
  19. });

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,