Here is a simple regex expression…
document.getElementById('testing').value=f2.innerHTML.replace(">",">\n");
The problem is it stops after the first linebreak, how can I make it do the whole table?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
.replace(/>/g, ">\n");.RegEx literal (or at least that’s what I call it) uses two
/‘s. One to mark the begninning, one to mark the end. If you need to use an actual / in the replacement, you’ll have to escape the / with a backslash (\). For example:/Hi\/Hello/.With RegEx literals, modifiers come after the last
/. In the case above, “g” means global and will replace all, not just the first one it comes to.