hi
i need to call javascript when a button clicked and put it in special location of page like as this code. but it does not work.
<html>
<head>
<script language="JavaScript">
function displayRSS()
{
var link = "'http://news.parseek.com/Javascript/?items=10&type=ALL&bullet=true&source=false'";
document.getElementById('myAnchor').innerHTML="<scr"+"ipt language = 'JavaScript' type='text/javascript' src="+link+"></scr"+"ipt>";
}
</script>
</head>
<body>
<input type="button" onclick="displayRSS()" value="Change link">
<div id="myAnchor"></div>
</body>
</html>
i used of DOM. but it does not work either.
<html>
<head>
<script language="JavaScript">
function displayRSS()
{
var link = "'http://news.parseek.com/Javascript/?items=10&type=ALL&bullet=true&source=false'";
var theNewParagraph = document.createElement('p');
theNewParagraph.setAttribute('title','The test paragraph');
var theText1 = document.createTextNode("<scr"+"ipt language = 'JavaScript' type='text/javascript' src="+link+"></scr"+"ipt>");
theNewParagraph.appendChild(theText1);
document.getElementById('myAnchor').appendChild(theNewParagraph);
}
</script>
</head>
<body>
<input type="button" onclick="displayRSS()" value="Change link">
<div id="myAnchor"></div>
</body>
</html>
what is soloution?