Solved

innerHTML jQuery

Posted on 2011-03-01
5
860 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
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.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

679 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