JQuery snippet - assistance required

0
Hello, I have added a custom html widget. I have been successful in adding formatting to a field which makes all characters lowercase.  $(".emailAddressInput").focus(); $(".emailAddressInput").children().css("text-transform", "lowercase"); This was great but now I need to trim out any spaces that may be entered. Using the .trim function I can use the entry as a string which I can be changed but I would need to change the above to accommodate this.  Any ideas on what code would be needed in this snippet to make all characters lower case AND remove any spaces entered? Thank you in advance :)
asked
1 answers
0

You can use the .replace function which uses regex: 

$(".emailAddressInput").focus();
$(".emailAddressInput").children().css("text-transform", "lowercase");
$(".emailAddressInput").children().replace(\s,'')

\s is regex for space

answered