I'm building a web application and experiencing a weird issue. I have a Sitecore RTF containing some formatted text and a link In my web application I have an HTML file with the following snippet:
<div class="AudiologiInfoText">
@Html.Sitecore().Field("AudiologiInfoBox")
</div>
and in my javascript file I have:
var x = $('.AudiologiInfoText')
if (x.length > 0) {
$('.InfoBoxText').replaceWith(x[0].innerText);
}
Running it on my machine, x[0] returns a div containing a string containing the text formatted with HTML tags When I run it on our test server, instead of being inside a string, the div directly contains the HTML tags.
This results in the innerText() call to lose the formatting on the test server.
The test server has a separate Sitecore client but I've input the exact same text in the same manner. I don't understand how it can be returning different results?