change text field color with an action?

jdh
jdh Community Member Posts: 16
Is there a way to change text color with an action? We have a page count text field located at the root of the course that needs to change color on certain pages due to image/object color behind it.

Comments

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    @jdh 49627 wrote:
    Is there a way to change text color with an action? We have a page count text field located at the root of the course that needs to change color on certain pages due to image/object color behind it.


    Add action to page: On Page Show --> Run Javascript --> document.getElementsByClassName('text38Font1')[0].style.color = "red";



    This might need some tweaking based on your page structure, but here are two changes you'll definitely need to make:

    -- change text38Font1 to whatever class your page counter span has

    -- change 'red' to whatever color you want