문제

I have a htmlText with this normal content:

<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT>...</FONT></P></TEXTFORMAT>

And user can customize my textFeild, so it would happen to have many <p> tags, inside this htmlText... How can I replace all these <p> tags to <span> ?

Thanks in advance :)

도움이 되었습니까?

해결책

htmlText.replace(/<(\/?)p([^>]*)>/gi, "<$1span$2>");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top