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).
- $('input[name="ipaddress"]').keyup( function(){
- 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})$/
- var val = $(this).val();
- if(!regexp.test(val)){
- $('#warn').val("Haaa");
- }
-
- } );
Seems it never changed the value of that span. I tried to use
also can not give me the proper result... But if I put on that line, an Alert. It just work, why, err...?