P.Brian.Mackey P.Brian.Mackey - 6 months ago 21
Javascript Question

jQuery - hide a span on document.ready

I want to hide a span on document.ready. I tried

<script type="text/javascript">
//Set the stuff we want to be able to use in javascript, but not display in the browser window invisible
$(document).ready(
function () {
('#_ctl0_ContentPlaceHolder1_lType').hide()
});
</script>


But, I get error "Object doesn't support this property or method" in IE7 debugger. I verified in the source that the object exists as a
<span>
and the id is correct.

Answer

Try this:

    $(document).ready(
        function () {
            $('#_ctl0_ContentPlaceHolder1_lType').hide();
        }
    );

You left off the $.