Posts

Showing posts with the label Html

validation city name from regex in javascript

Mostly this pattern used for US cities. It will be accept small and capital character, space, desh and full stop. if (/[^a-zA-Z .,]/.test(txtCity.value)) {           alert('Invalid city name');      } else {           alert('Valid city name');      }

Set span value using jquery and javascript

Solved: Jquery Example: you can set value two different function. 1- text(); 2- html(); $ ( "#submittername" ). text ( "testing" ); $ ( "#submittername" ). html ( "testing <b>1 2 3</b>" ); Difference between text and html functions text - you can set only value html - you can set value with html code but html tags not necessary for set the value JavaScript Example; you can set value from innerHTML document. getElementById ( "spanID" ).innerHTML. ( "testing" );

Stop resizing textarea html

Disable textarea resizable functionality textarea {      resize: none; } You can also resize textarea horizontal or vertical. textarea {      resize: vertical; } textarea {      resize: horizontal; }