Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > a variable inHTML?

Thread Tools

a variable inHTML?

Posts: n/a
Can I have a variable in plain HTML?

pseudo such as:

<variable color="White">

<input type=text value=color>

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.

Reply With Quote
Toby A Inkster
Posts: n/a
Bob wrote:

> Can I have a variable in plain HTML?


> 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 ~
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Reply With Quote
Andy Dingley
Posts: n/a
On 14 Feb, 16:52, Bob <(E-Mail Removed)> wrote:
> Can I have a variable in plain HTML?


> 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.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
how to implement variable ports with variable width? weijun VHDL 4 12-19-2005 05:16 PM
Variable 'variable lengths' Taras_96 VHDL 2 05-09-2005 12:58 AM
Convert Character Variable to Integer Variable Brad Smallridge VHDL 2 11-18-2004 01:56 AM
How do I scope a variable if the variable name contains a variable? David Filmer Perl Misc 19 05-21-2004 03:55 PM