I'm attempting to replicate an element on a webpage, but I'm unsure of the process. Can this be achieved using CSS alone, or do I need to utilize a script?
Here is what I have in mind:
#yan:before {
content: Get The Value Of(AN.element.inPage) !important;
font-size: 200% !important;
}
For example: Let's say I want to retrieve the title of a topic.
#yan:before {
content: Get The Value Of(h1.subject) !important;
font-size: 200% !important;
}
Would it be feasible for the topic title to appear twice on the page? Is this possible?
This is the code that works for me:
// ==UserScript==
// @name DUPLICATING - CLONE elements
// @namespace http://userscripts.org/scripts/show/109262
// @description PLEASE EXPLAIN THIS TO ME
// @include http*://*answers.yahoo.com*
// @version 1
// ==/UserScript==
var yan = document.getElementById('yan'),
h1s = document.querySelectorAll('h1.subject');
[].forEach.call(h1s, function(node) {
// insert before
yan.parentNode.insertBefore(node.cloneNode(true), yan);
});
►►►► However, how can I position the newly created element relative to the "#yan-related" element? ►►►► I would like the new element to follow the #yan-related one.