1 reply [Last post]
johnywhy's picture
Last seen: 6 weeks 1 day ago
Timezone: GMT-8
Joined: 2010-03-11
Posts: 27
Points: 37


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.


Ed Seedhouse
Ed Seedhouse's picture
Victoria British Columbia
Last seen: 1 year 50 weeks 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.