Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jquery select a parent element but not a nested child

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28460
    blue642
    Member

    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?

    #72667
    noahgelman
    Participant
    Code:
    $(document).ready(function() {
    $(‘#callout > a’)
    });

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

    #72671
    blue642
    Member

    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)
  • The forum ‘JavaScript’ is closed to new topics and replies.