I've made good progress with a script I'm writing that will link <q />s to their cite attribute URI, but I've hit yet another roadblock...
To link to the cite URI of <q /> elements, I want to basically wrap the existing quote text in an <a />. To do this, I thought it would be easy enough to capture the original <q /> text in a variable, then drop all child nodes of the <q /> and replace them with the newly constructed <a /> that contains the original <q /> text.
I've got this working fine, but I'm having issues with the recognition of child nodes that are <img /> elements. In WordPress, for example, certain smilies are converted to images. If a smiley is used in a quote, I want to grab the value of the <img />'s alt attribute before dumping the <img /> element as well as any other text nodes.
I'm not getting the <img />'s alt value in my variable holding the original <q /> text, and the <img /> elements aren't being dropped either.
An example page here:
http://sethrasmussen.com/common/js/q-child-nodes.html
The script here:
http://sethrasmussen.com/js/_exit.js
***
I cross posted this from my other thread because I thought the specific title might get better attention. I've googled ad nauseum, etc. I can't seem to find anything pointing to why removeChild might not be working in this instance.