Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jQuery value within div undefined

Posted on 2016-11-08
3
Medium Priority
?
65 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 2000 total points
ID: 41878910
try el.innerHTML

instead of
el.innerhtml

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

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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
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 transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

705 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