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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Accessing css from javascript in a ASPX form.

Accessing css from javascript in a ASPX form.

Scheduled Pinned Locked Moved Web Development
javascriptcssdatabasequestion
5 Posts 4 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.
  • S Offline
    S Offline
    Steve Holdorf
    wrote on last edited by
    #1

    I have a gridview that row's cells contain textboxes. Currently, I highlite the row, in yellow using javascript, by changing the backgroundColor of each of the rows cell's textboxes. To set the backgroundColor I use the .childNode[0].style.backgroundColor = 'Yellow', see code below: gridViewCtl.rows[index].cells[i].childNodes[0].style.backgroundColor = 'Yellow'; Now, I have a set of css files defined and would like to use a color defined in my css. Does anyone know how this can be done? Thanks, Steve

    N G V 3 Replies Last reply
    0
    • S Steve Holdorf

      I have a gridview that row's cells contain textboxes. Currently, I highlite the row, in yellow using javascript, by changing the backgroundColor of each of the rows cell's textboxes. To set the backgroundColor I use the .childNode[0].style.backgroundColor = 'Yellow', see code below: gridViewCtl.rows[index].cells[i].childNodes[0].style.backgroundColor = 'Yellow'; Now, I have a set of css files defined and would like to use a color defined in my css. Does anyone know how this can be done? Thanks, Steve

      N Offline
      N Offline
      NeverHeardOfMe
      wrote on last edited by
      #2

      Don't cross-post - it's bad forum etiquette

      S 1 Reply Last reply
      0
      • N NeverHeardOfMe

        Don't cross-post - it's bad forum etiquette

        S Offline
        S Offline
        Steve Holdorf
        wrote on last edited by
        #3

        Sorry, I thought I placed it in the wrong forum but will not do it again.

        1 Reply Last reply
        0
        • S Steve Holdorf

          I have a gridview that row's cells contain textboxes. Currently, I highlite the row, in yellow using javascript, by changing the backgroundColor of each of the rows cell's textboxes. To set the backgroundColor I use the .childNode[0].style.backgroundColor = 'Yellow', see code below: gridViewCtl.rows[index].cells[i].childNodes[0].style.backgroundColor = 'Yellow'; Now, I have a set of css files defined and would like to use a color defined in my css. Does anyone know how this can be done? Thanks, Steve

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Specify a class in the css, and use the className attribute in Javascript to set the class of the rows or the class of an element containing the rows.

          Despite everything, the person most likely to be fooling you next is yourself.

          1 Reply Last reply
          0
          • S Steve Holdorf

            I have a gridview that row's cells contain textboxes. Currently, I highlite the row, in yellow using javascript, by changing the backgroundColor of each of the rows cell's textboxes. To set the backgroundColor I use the .childNode[0].style.backgroundColor = 'Yellow', see code below: gridViewCtl.rows[index].cells[i].childNodes[0].style.backgroundColor = 'Yellow'; Now, I have a set of css files defined and would like to use a color defined in my css. Does anyone know how this can be done? Thanks, Steve

            V Offline
            V Offline
            Vengatachalapathy Palanivel
            wrote on last edited by
            #5

            Hi you can make use of this piece of code

            gridViewCtl.rows[index].cells[i].childNodes[0].className = 'your_class_name';

            Hope this helps.

            Regards, Vengat P

            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