Solved

innerHTML jQuery

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to dynamically set the form action using jQuery.
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).

776 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