Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: JQuery help

  1. #1
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts

    JQuery help

    Hey,

    I started using JQuery today and I'm trying to replace some codes with it since it doesn't recognize the document.getElementsByTagName anymore.

    I have a problem with the function $. I'm using a function which gets a parameter of an unknown object like this:
    Code:
    function myfunction(obj)
    Then I would like to get all the img tags inside this object. What I would have done is:
    Code:
    function myfunction(obj)
    {
    var imgs = obj.document.getElementsByTagName('img');
    }
    But I can't seem to find the solution using jquery.

    Can anyone help me with this?

    Thanks.
    Last edited by BarrMan; 09-07-2009 at 05:31 AM.

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    OK, I found what the answer is.
    Code:
    function myfunction(obj)
    {
    var imgs = obj.find('img');
    }


  •  

    Posting Permissions

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