Results 1 to 3 of 3

Thread: Find Container Tag

  1. #1
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default Find Container Tag

    First of all, AHHHHHH! Okay, now that that is out of the way, lets continue.

    I need to know how to create a JavaScript that will find out what and where the tag/tags is/are that contain the text "$body". For example:

    Code:
        <html>
    <head>
    </head>
    <body>
        <div>Hello</div>
        <div>$body</div>
        <table>
            <tr>
                <td>Hi!</td>
                <td>Hello!</td>
                <td>$body</td>
            </tr>
        </table>
    </body>
        </html>
    The JavaScript would need to return a reference for the second div and the third td so that they can be manipulated.
    Does all of that make sense?

    I am not looking for actual code so much as direction (but if you feel compelled to write the script, I won't turn you down ). I am pretty competent at writing in JavaScript, but I've never done this before.
    Last edited by Jas; 05-21-2008 at 03:26 PM.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Stand by, I think I may have figured it out.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    you could do a indexOf() search to find the string, save it to a variable then grab the parent tag... however that will just tell you what type of tag it is, unless you a way to uniquely identify it from the rest of the tags surrounding it, it would be hard to replicate it unless you wanted to do that immediately.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •