Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. How to get td background value?

How to get td background value?

Scheduled Pinned Locked Moved JavaScript
helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    elelont2
    wrote on last edited by
    #1

    Hi, I am trying to remove get some url's from a site using opera userjs feature. The problem is that the site uses the following syntax to set td background:

    Edit: i dont't know why cp replaces some things: 1) td removed -> td background 2) background-removed -> background-position I can access the style attributes just fine, but i cannot get the value of the background image. I try to use it like this (prints undefined):

    alert(img.parentNode.parentNode.background);

    This works (but does not give me what i need):

    alert(img.parentNode.parentNode.style.background);

    How does the last one even work, i cant find the .background attribute from w3schools, i see that background-image attribute is available. But mainly, how to get the td background=... value? Thanks

    Z 1 Reply Last reply
    0
    • E elelont2

      Hi, I am trying to remove get some url's from a site using opera userjs feature. The problem is that the site uses the following syntax to set td background:

      Edit: i dont't know why cp replaces some things: 1) td removed -> td background 2) background-removed -> background-position I can access the style attributes just fine, but i cannot get the value of the background image. I try to use it like this (prints undefined):

      alert(img.parentNode.parentNode.background);

      This works (but does not give me what i need):

      alert(img.parentNode.parentNode.style.background);

      How does the last one even work, i cant find the .background attribute from w3schools, i see that background-image attribute is available. But mainly, how to get the td background=... value? Thanks

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      try background-image. or use jQuery and do $("#id").attr("backround-image")

      There are only 10 types of people in the world, those who understand binary and those who don't.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups