a variable inHTML?

Discussion in 'HTML' started by Bob, Feb 14, 2007.

  1. Bob

    Bob Guest

    Can I have a variable in plain HTML?

    pseudo such as:

    <variable color="White">

    <form...>
    <input type=text value=color>
    </form>

    and have the word White as the value that appears in the textfield
    on the browser's page. If that can't be done purely in HTML, how
    best to work around? Thanks.

    My intended purpose is to declare variables at the top of the code,
    where easily visible and available to change, and have the effects
    work later on throughout the working code.
    Bob, Feb 14, 2007
    #1
    1. Advertising

  2. Bob wrote:

    > Can I have a variable in plain HTML?


    No.

    > If that can't be done purely in HTML, how best to work around?


    Server-side scripting. (e.g. PHP.)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

    * = I'm getting there!
    Toby A Inkster, Feb 14, 2007
    #2
    1. Advertising

  3. Bob

    Andy Dingley Guest

    On 14 Feb, 16:52, Bob <> wrote:
    > Can I have a variable in plain HTML?


    No.

    > pseudo


    Sort of (macro expansion through server-side scripting), but it's a
    rare occasion when that's of real practical use.

    > <variable color="White">


    What's your _real_ purpose for doing this? If it's to have some sort
    of indirection between context and presentation, then CSS and the HTML
    class attribute already does pretty much all you could want.

    Otherwise tell us what you need to achieve (rather than how you've
    already decided it ought to be implemented) and maybe we can give a
    better idea.
    Andy Dingley, Feb 14, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brad Smallridge
    Replies:
    2
    Views:
    2,488
    Brad Smallridge
    Nov 18, 2004
  2. Taras_96

    Variable 'variable lengths'

    Taras_96, May 8, 2005, in forum: VHDL
    Replies:
    2
    Views:
    488
    Taras_96
    May 9, 2005
  3. mfglinux
    Replies:
    11
    Views:
    678
    Roberto Bonvallet
    Sep 12, 2007
  4. vinay
    Replies:
    12
    Views:
    1,978
    Athel Cornish-Bowden
    Aug 19, 2009
  5. David Filmer
    Replies:
    19
    Views:
    222
    Kevin Collins
    May 21, 2004
Loading...

Share This Page