👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.
js check for carraige return

The following checks whether a string contains a line break (\n o r \r) :

var str = "abc \n def";
if (/\r|\n/.exec(str)) {
	// Do something, the string contains a line break

}

More