Hello, I'm using document.nodeName.innerHTML to change the content of a particular node. It is not working in my case. Can someone please let me know where I've went wrong.Thanks in advance. Please find the below code. On click of a link, I need to change the text of that link.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title> New Document </title>
</head>
<body>
<script type="text/javascript">
var currentDOMId="";
var currentPrefKey="";
function SimpleJSPortlet(id, window) {
this.id = id;
this.window = window;
this.nodeId="";
this.prefKey="";
}
function handleLoadPortletPreferences (portletWindow, status, portletPrefs) {
alert("CURRENT DOM ID"+currentDOMId);
alert(document.getElementById('Aircraft').innnerHTML);
document.getElementById('Aircraft').innnerHTML="Remove from Favorite";
}
SimpleJSPortlet.prototype.addListItem = function (key,value,nodeId) {
currentDOMId=nodeId;
currentPrefKey=key;
handleLoadPortletPreferences();
}
</script>
<style type="text/css">
#productPreferncesDetails dt{
color:#000000;
}
</style>
<div id="productsPreferences" style="left: 0pt; width: 100%;">
<table border="1" cellpadding="0" cellspacing="0" height="100" width="100%">
<tbody>
<tr valign="top">
<td style="padding-left: 15px;">
<b>Aviation Insurance</b>
Aircraft
<a id="Aircraft" href="javascript:void(0);" onclick="simpleJSPortlet7_21602B8280FH00I41OSVRO10G3.addListItem('Aircraft','javascript:void(0);','Aircraft');">Add to Favorites</a>
</td>
</tr>
</tbody>
</table>
</div>
<div id="show7_21602B8280FH00I41OSVRO10G3">
<!-- Show dynamic HTML here -->
</div>
<div id="programmatic">
</div>
<script type="text/javascript">
var portletWindow7_21602B8280FH00I41OSVRO10G3= "";
var simpleJSPortlet7_21602B8280FH00I41OSVRO10G3= new SimpleJSPortlet("7_21602B8280FH00I41OSVRO10G3", portletWindow7_21602B8280FH00I41OSVRO10G3);
</script>
</body>
</html>