Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>links</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript">
<!--
function preview()
{
document.getElementById("preview").innerText = document.add_link.text.value;
document.getElementById("preview").title = document.add_link.title.value;
document.getElementById("preview").href = document.add_link.href.value;
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<form name="add_link" action="link.php" method="post">
<div>preview : <a id="preview" href="" title=""></a></div>
<div><br>href <input type="text" size="67" name="href" value="http://"></div>
<div><br>title <input type="text" size="67" name="title"></div>
<div><br>text <input type="text" size="67" name="text"></div>
<div><br><input type="button" value="preview link" onclick="javascript:preview()"></div>
</form>
</body>
</html>The problem is the preview doesn't work in firefox as it uses stuff only available to msie. I did a bit of searching and I can't see anyway to alter the link attributes that will work with firefox. Is there anyway to get it to work with both msie and firefox?