replace paragraph to new line javascript code example Example: javascript replace p tags with new line str = str.replace(/<p>(.*)<\/p>/g, "$1\n");