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 8 of 8
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    280
    Thanks
    25
    Thanked 9 Times in 9 Posts

    assign id's to images

    Hi, i know very little of javascript and was hoping that someone could help. i need a script that on load, every image that is within a certain textarea would be assigned a random id (id="img_bd53k3"). Any help would be much appreciated.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    HUH?? You can't have images "within a certain textarea". In fact, you can't have *ANY* other HTML tags between a <textarea> and its matching </textarea>.

    Want to try again???

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by snowysweb View Post
    Hi, i know very little of javascript and was hoping that someone could help. i need a script that on load, every image that is within a certain textarea would be assigned a random id (id="img_bd53k3"). Any help would be much appreciated.
    Why on earth do you "need" this?

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Now, now, Philip: That's MUCH too sensible a question.

    (Why didn't I think to ask it?)

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Why on earth do you "need" this?
    Maybe she's not from around here ...

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    LOL!!! VERY nice!

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    ... apparently now trying his/her luck in The DOM Zone ...

  • #8
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    .. and in PHP

    random id attributes


  •  

    Posting Permissions

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