When I want to extract data from a textarea of list and put it into another textarea , I have the problem of div. it look like this when my information appears

enter image description here

I want to remove the start (div) and the last (div) and conserve my text ! I am working in sharepoint online using JavaScript. thanks for help !

  • Please share the code used so far – Robert Lindgren Aug 15 '14 at 11:37
  • 1
    Yes, we don't know how you do the copy from one textarea to the other. Is this also done in javascript or are you using something else? – Christoffel de Gruyter Aug 15 '14 at 11:49
  • i'm using just javascript and the textarea in two diifferent lists – user32312 Aug 15 '14 at 13:03
  • 1
    Please share the code. I will give you a 2 line solution – Malin De Silva Aug 15 '14 at 14:10

To strip the Html, you could do something like this:

function stripHtml(body) {
    var regex = /(<([^>]+)>)/ig;
    var result = body.replace(regex, "");
    return result;

If you're using jQuery, you can use text() function ex.

var divText = $("#myDiv").text();
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.