Web Analytics Made Easy -
StatCounter assigning ids - CodingForum

Announcement

Collapse
No announcement yet.

assigning ids

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • assigning ids

    Can i assign an img a id like this:

    when the img is mouse over i will check for an class if that class is img then i want to give the img and id

    how can i do this?
    http://www.bluephoenix.uni.cc/

  • #2
    I'm not very sure of what you want but you may try this:

    function getImageNum(n) {
    var src = n.getAttribute('src');
    return src;

    Whenever an image is displayed on the screen, it receives automatically an id. With getAttribute you can retrieve it.

    Hope this helps.

    Richard

    Comment


    • #3
      helps alot thanks
      http://www.bluephoenix.uni.cc/

      Comment

      Working...
      X