Solved

jQuery value within div undefined

Posted on 2016-11-08
3
56 Views
Last Modified: 2016-11-08
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.
0
Comment
Question by:Howard Bash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
Paweł earned 500 total points
ID: 41878910
try el.innerHTML

instead of
el.innerhtml

http://www.w3schools.com/jsref/prop_html_innerhtml.asp
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 41878918
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

0
 
LVL 1

Author Closing Comment

by:Howard Bash
ID: 41878919
Duh.  Thanks.  It was a case of wrong case. ;-)
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question