
Originally Posted by
eurows
This script gives me an error. What have I done wrong?
middleAdvertLink = "<a href=""http://www.theranger.co.uk"" target="_blank">"
The above mentioned code will gives you error because you've used double quotes within double quotes which is not the correct usage.
You can use the following
Code:
middleAdvertLink = "<a href='http://www.theranger.co.uk' target='_blank'>"
I think you need the same value you've mentioned in your query.
Following is an example of the same
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
</style>
<script type="text/javascript">
window.onload = function() {
var aElem = "<a href='http://www.google.com' target='_blank'>Visit Google</a>";
document.getElementById('one').innerHTML = aElem;
}
</script>
</head>
<body>
<div id="one"></div>
</body>
</html>
Bookmarks