1

So I have been stuck on this jQuery problem for days at this point. I am working on a Web Application that was derived from Mobile and my company goes through NetBiscuits for mobile.

Long story short NetBiscuits uses their own markup and I cannot get this string'[BR][BR]'from showing up in an error message. [BR] is the BML of line break and I need some jQuery to take that sucker out of our web app!

[ ] essentially needs to be < > or nothing (preferred)

I gave the form: errors a div id of "erMsg." Here's my code in javascript:

document.getElementById("erMsg").value = document.getElementById("erMsg").innerHTML(erMsg.replace('[BR][BR]', '<br><br>')); 

I have tried countless methods and practices both using jQuery and JS, innerHTML and replace(). ANY help would be most graciously accepted.

Ralph
  • 118,862
  • 56
  • 287
  • 383
Abraxas
  • 374
  • 3
  • 10

1 Answers1

3

innerHTML is not a function, it's a property. You assign to it.

Try this:

var elem = document.getElementById('erMsg');
elem.innerHTML = elem.innerHTML.replace(/\[br\]/ig,'<br />');
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592