Results 1 to 25 of 31
Thread: Now here's a puzzler.....!
Jul 13, 2002, 04:57 #1
- Join Date
- Jan 2002
- 0 Post(s)
- 0 Thread(s)
Now here's a puzzler.....!
It is with great satisfaction that I at last post the first problem that I haven't been able solve myself(!!!), and simultaneously reach my 800th post!
I am trying to get retrieve the inner HTML (i.e. the HTML in between the <a> and </a> tags) of an anchor tag when I click on the link. This should be easy enough to do using the .innerHTML property, and indeed it is most of the time, but there appears to be an exception when it comes to character entities (e.g. "& pound;" - please note that spaces have been intentionally inserted where needed throughout this post in order to overcome the usual shortcomings in vB's handling of HTML code)
At this point I should probably point out that in this particular case I'm not concerned with cross-browser compatibility - I only need this to work in IE4 and up.
Here's some simple test code to demonstrate the problem:
Wrong, unfortunately!!! The first displays as expected, but the second displays this:Code:
For total clarification, what I want is this:<b>& pound;</b><b>£</b>Code:
You would have thought that returning the unparsed HTML code from the contents of an element would be pretty elementary (pun intended), but it seems that it is not! It must be possible to do such a basic thing!
So, answers on a postcard to the usual address.....!
(Thinking caps on, everyone!)
Last edited by M@rco; Jul 13, 2002 at 10:16.MarcusJT
- former ASP web developer / former SPF "ASP Guru"
- *very* old blog with some useful ASP code
- Please think, Google, and search these forums before posting!