Wazzzy Wazzzy - 2 years ago 91
Javascript Question

Using jQuery in a JavaScript function

function divlightbox(val)
val=val.replace( /^\s+/g, "" );
var count_js=0;
var big_string='';
document.getElementById("divlightbox").style.display = "block";

I found out that the error is in the above. My question is can't I use jQuery and traditional JavaScript at same time? I have done coding like this numerous times and never ran into a problem like this. I used to use jQuery methods like
inside JavaScript functions but this time it doesn't work.

Thanks in advance.

Answer Source

to do things like hide(); and css() you need jquery objects. you can't do them to dom elements.

so you could do $('#video_lightbox').html(""); or

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download