1 reply [Last post]
johnywhy
johnywhy's picture
Offline
Regular
Last seen: 6 weeks 15 hours ago
Timezone: GMT-7
Joined: 2010-03-11
Posts: 25
Points: 34

hi-yo

is there a way two divs can display the same text, where the text appears only once in the html?

or, is there a way to make a div mirror the contents of another div, without explicitly typing those contents twice into the html?

or, is there a non-javascript way to dynamically copy text from one element to another?

this does not have to be a css solution, it might be plain html.

thanks!

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 46 weeks 1 day ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

The answer is that neither

The answer is that neither HTML nor CSS can do that. You need a programming language to do that, whether browser side or server side. Javascript can do it on the browser side, PHP, ASP, even Perl or C can do it on the server side.

HTML is called a markup language for a reason! It is NOT a programming language, which is of course why javascript was invented.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.