Link to home
Start Free TrialLog in
Avatar of Howard Bash
Howard BashFlag for United States of America

asked on

jQuery value within div undefined

When I query my page in the console,  I get back the innerhtml.  However, when I try to do this in a routine, the value I get back is undefined.

The code follows:
$('.testimonial').each (function() {
					var el = this;
					var rawhtml=el.innerhtml;
					el.innerhtml = CleanHTMLBody(rawhtml);					
				});

Open in new window


I can see "el" in the console has a div, but the innerhtml assignment fails and rawhtml is undefined.

Please advise.
ASKER CERTIFIED SOLUTION
Avatar of Paweł
Paweł
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Julian Hansen
If you are using jQuery why are you using innerHTML
What does CleanHTMLBody do?
$('.testimonial').each (function(i, el) {
  var html = CleanHTMLBody($(e).html());
   $(e).html(html);
});

Open in new window

Avatar of Howard Bash

ASKER

Duh.  Thanks.  It was a case of wrong case. ;-)