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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now