dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] text color

  1. #1
    Join Date
    Jul 2013
    Posts
    21

    resolved [RESOLVED] text color

    i am making a text adventure game and i was wondering if i could some how change the color of text then put that text in a var with other text and output it some how so it keeps its color sort of like this

    var a = "red text "
    var b = "blue text "
    var c = "greentext "
    var all = a + b + c

    document.write (all)

    red text blue text green text

    i hope you understand what i mean
    thanks

  2. #2
    Join Date
    Jul 2013
    Posts
    11
    maybe
    var a ="<span style='color:red'>red text </span>";
    var b ="<span style='color:blue'>blue text </span>";
    ...

    TODO: improve (style = css class,...)

  3. #3
    Join Date
    Jul 2013
    Posts
    21
    o cool thank it worked

    i can even use it like this

    var A = redtext
    var all = "<span style='color:red'>" + A + "</span>"

    thanks a lot on the quick response

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles