Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to make a regex test caret sign which is global on a html element

I am trying to make a cash register using javascript and on every new line i add via a function the $ sign using the string.test(regex is ^\$.+). When the user enters a few digits and presses enter, the function adds in a br / element in the html. but in html there is only the br / and no newline \n or \r. Is it possible to check for every break the regex test again. The regex has the global flag. Many thanks

Comments