javascript regex and a span that can not changed

javascript regex and a span that can not changed

Hahaha, hello again everyone...

Pardon me if i'm a bit confused while trying this jquery.
This week I'm with jquery almost in every day.... GeeZZ.... (may god forgive me).

Anyway,
here I have;

1 textfield namely as  ipaddress
1 span with unique ID as  warn


and once I use this jquery; (to validate each time the user type something at that input textfield).

  1. $('input[name="ipaddress"]').keyup( function(){

  2.         var regexp = /^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/
  3.         var val = $(this).val();
  4.         if(!regexp.test(val)){
  5.             $('#warn').val("Haaa");
  6.         } 
  7.         
  8.     } );

Seems it never changed the value of that span. I tried to use

  1.             $('#warn').text("Haaa");
also can not give me the proper result... But if I put on that line, an Alert. It just work, why, err...?