innerHTML jQuery

Posted on 2011-03-01
Last Modified: 2012-05-11
How do I use this code:

if (document.getElementById("id").innerHTML != '') {...}

Open in new window

but have the jQuery equivalent. I would like to use jQuery.

Thank you,

Question by:Victor Kimura
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
LVL 82

Accepted Solution

leakim971 earned 500 total points
ID: 35008769
if( $("#id").html() != "" ) { ... }

Open in new window

LVL 40

Expert Comment

ID: 35008785
if ( $("#id").html() == "" )
LVL 40

Expert Comment

ID: 35008790
if ( $("#id").html() != "" )
LVL 19

Expert Comment

ID: 35008805
Off the top og my head it is $('#id').html().

Author Closing Comment

by:Victor Kimura
ID: 35009070
Thanks, guys. leakim answered first so I felt I should give him the credit. Thanks, though. I appreciate it as I know you guys have answered other questions I've posted. =)

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

729 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