Has anyone successfully used a jQuery script to add unique ids to all the elements in the DOM? Seems like this should work.
Here is the script I tried in the document ready:
$("h1").each(function(index, element){$(element).attr("id", "h1-"+index);});
$("p").each(function(index, element){$(element).attr("id", "p-"+index);});
$("img").each(function(index, element){$(element).attr("id", "img-"+index);});
$("a.lightbox1").each(function(index, element){$(element).attr("id", "lb-"+index);});
(Does the ID need to be unique across a page, or across the whole site?)
I've also tried setting up jquery to add the cms-editable class:
$("h1").addClass("cms-editable");
$("p").addClass("cms-editable");
$("img").addClass("cms-editable");
$("a.lightbox1").addClass("cms-editable");
Neither seem to add anything to the DOM in view source; the second script breaks the layout...