SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    document.write - with a css tag (please!!)

    here's my code:

    var x = "welcome";

    document.write("<span class="header2">" + x + "</span>");


    Now..I can get x to show in the page, but it doesn't come with the style declared. probably something to do with the quotations....

    any help would be great!!!

  2. #2
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got a short term fix...
    just moved the <span> tags around my <script> tags and that's currently working....

  3. #3
    SitePoint Zealot infoxicated's Avatar
    Join Date
    Jun 2001
    Location
    UK
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Try

    document.write('<span class="header2">' + x + '</span>');

    Switching to single quotes should help

    Best of luck with it.


Bookmarks

Posting Permissions

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