Is there a way to make a string variable in "normal" html (that is, not inside of a <script> tag)? I want to do something like

Number='005'
<a href="http://domain.com/"+Number+".html">my link</a>

Is this possible?

Thanks,

David

Recommended Answers

All 3 Replies

I'm not aware of support for this outside of scripting, with the emerging exceptions of certain things in HTML5 (like client side storage). I presume the CSS spec may one day evolve to support things like mixins, but we'll have to wait awhile for those things to be well defined, supported, and widely available to a substantial set of browsers.

Is there a way to make a string variable in "normal" html (that is, not inside of a <script> tag)? I want to do something like

Number='005'
<a href="http://domain.com/"+Number+".html">my link</a>

Is this possible?

Thanks,

David

You need PHP for this. HTML cannot analyze data; it can only display it.

$Number='005';
echo '<a href="http://domain.com/'.$Number.'.html">my link</a>';

Thanks all. I thought this might be the case, but I thought I'd double check.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.