Solved

innerHTML jQuery

Posted on 2011-03-01
5
856 Views
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,
Victor

0
Comment
Question by:Victor Kimura
5 Comments
 
LVL 82

Accepted Solution

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

Open in new window

0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35008785
if ( $("#id").html() == "" )
{
}
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35008790
if ( $("#id").html() != "" )
{
}
0
 
LVL 19

Expert Comment

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

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. =)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This video teaches users how to migrate an existing Wordpress website to a new domain.
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.

758 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

21 Experts available now in Live!

Get 1:1 Help Now