Results 1 to 3 of 3

Thread: Setting Text-Decoration via JavaScript

  1. #1

    Thread Starter
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444

    Setting Text-Decoration via JavaScript

    I am trying to use this code:

    Code:
    document.getElementById('elementId').style.text-decoration = 'blink';
    But I get an error about the hypen in between text and decoration. Is there a work around or can I use something like:

    Code:
    document.getElementById('elementId').style['text-decoration'] = 'blink';

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Try .textDecoration

    the "-" is a mathematical operator in javascript.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Thanks Josh. It worked, but it doesn't seem to make the text blink (tried in in Mozilla by the way not IE, so that's not the problem). Oh well it's not that important anyway.

Posting Permissions

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



Click Here to Expand Forum to Full Width