Reading through the documentation, it seems that either would work, if
you provide a selector...

Try something like..

var $html = $("#DivID").html();
$("br", $html).replaceWith("\r\n");

could maybe work? I'm no expert on this at all, that's just my initial
thought.

On Dec 9, 9:49 am, Mad-Halfling <mad-halfl...@yahoo.com> wrote:
> 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 replaceAll or replaceWith or do
> I need to use regexs?
>
> Sorry for such a silly question, but I can't quite get my head around
> how to use those methods and if I can use them on plain text as they
> seem to either run on the whole doc or (if used in an element's
> function) "this".

Reply via email to