views:

91

answers:

1

Hello, I am updating some super legacy code and I am unsure how to make this HTML5 compatible.

<option value='<a href='http://localhost:8080/dm?id=&amp;#037;&amp;#037;SUBSCRIBER_ID_TAG&amp;#037;&amp;#037;'&gt;View in a browser window</a>'>Display Message(HTML Version)</option>

I personally have never run across something like that so any help would be great.

+1  A: 

Do you have access to the server side code? I'm presuming that somehow this value is populating a page.. I'd recommend you just pass the URL for the value, and in your server side code (or even if it's rendering in JavaScript) build link. Moreover, I suspect this code is highly susceptible to XSS, since it apparently renders whatever HTML is passed along.

Billy Cravens
Looking at it further it appears that it is using the value to actually display it at another spot on the html page.
Craig
Same situation, whether that rendering is done server-side or client-side. So if it's just a document.write or similar, pre-build your <a> code, grabbing the URL from the <option> value, rather than outputting the value as an entire HTML block. This will help you get to HTML 5 conformation.
Billy Cravens