[jQuery] Replacing brs in a div

2009-12-09 Thread Mad-Halfling
Hi, this seems like a stupid question, but I'm not quite sure if I can do it or not. I am copying the contents of a div into a textarea like this:- $('#TextAreaID').append($('#DivID').html()); and it works ok, but I need to replace any br / tags in the divs content with \r\n - can I do this with

Re: [jQuery] Replacing brs in a div

2009-12-09 Thread Michel Belleville
Regexp seems indeed the simplest way to acheive it. Something like this might just work : whatever_string.replace(/(\/?)\s*br/gi, \r\n) Michel Belleville 2009/12/9 Mad-Halfling mad-halfl...@yahoo.com Hi, this seems like a stupid question, but I'm not quite sure if I can do it or not. I am