Chris West
Chris West

Reputation: 741

Reusing existing Dom Elements and have them displayed in multiple sections at the same time

I was wondering if it is possible to reuse existing dom elements in html. Not just simply move them but to display elements at the same time on multiple spots. Like references. I'm having the problem, that I need to display the same content multiple times, because of an responsive design. Is it possible to achive this in a manor similiar to object orientated programming?

Upvotes: 0

Views: 167

Answers (2)

useSticks
useSticks

Reputation: 904

You cannot have "pointer" DOM elements.

You can get similar behavior if you are using GWT as you can use the element multiple times. This applies it to the page in duplicates, but has the effect you want. If you are not using GWT, you may want to look into it. It allows you to write Java and compile it into a responsive webpage (HTML & JavaScript). This lets you do OO in a clean way with your web programming.

You can also use jQuery event handlers to make object seem to be the same. For example, each button has the same effect when clicked.

Upvotes: 1

steinmas
steinmas

Reputation: 398

Jquery could definitely do something like this. It's a javascript plugin available here. It's client-side code that allows you to manipulate dom elements.

Upvotes: 1

Related Questions