Grow your CSS skills. Land your dream job.

jquery select a parent element but not a nested child

  • # March 19, 2010 at 9:56 pm

    Hello,

    I have markup that looks as such…

    Code:

    Here you can learn more about me,

    listen to my music, view my photos,

    check out upcoming shows,

    or send me a message

    and I need to select the paragraph, but exclude the anchor tag…

    I cannot figure thi out, anyone know how? or a workaround?

    # March 21, 2010 at 1:42 am
    Code:
    $(document).ready(function() {
    $(‘#callout > a’)
    });

    This targets the div with an id of callout without targeting the child

    # March 21, 2010 at 7:31 am

    Actually, that targets nothing in my case. It targets an "a" tag that is a direct descendant of the #callout div.

    I figured this out though, for my purposes using html worked instead of text (turns out Google doesn’t translate HTML tags into Spanish :) )

    you can view it here… http://tests.dingledoodle.com/marcos/site/ the picture is just for prototyping, professional portait will be there before we go live.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".