PDA

View Full Version : How to turn off link underlining with this JS?



pstein
Jan 31st, 2014, 03:55 PM
Assume I code soemthing like the following in JavaScript to insert the current URL:

var address = document.URL;
var pane = document.getElementsByClassName("x3header")[0];
pane.innerHTML = "URL: <a href=\"" + address + "\">" + address + "<\a>";

It works fine for me except the fact that the link is underlined.

How can I turn off underlining for the link?

The following does not work:

var address = document.URL;
var pane = document.getElementsByClassName("x3header")[0];
pane.innerHTML = "URL: <a href=\"" + address + " text-decoration: none; \">" + address + "<\a>";

How else?
The "NO_underlining" instruction should be put into the JS cmds above and NOT in a separate CSS style sheet.

Peter

rnd me
Jan 31st, 2014, 04:47 PM
pane.innerHTML = "URL: <a style=text-decoration:none href=\"" + address + "\">" + address + "<\a>";