change attr value if value =

change attr value if value =

I want to change all fill values into svg  when clicking a button,  but only if a color == #18B0FE , if  color != #18B0FE  I do nothing
I am trying

  1. $(".map-close").click(function() {
  2. $('path').attr('fill').each(function() {
  3. if($(this).is('#18B0FE')){
  4. $('path').attr('fill', '#01283F'); 
  5. }
  6. });
  7. });
but it doesn't work

thanks for your help