a variable inHTML?

B

Bob

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

Andy Dingley

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top