Thursday, 21 February 2013

<script language="javascript">
function changeText(idElement){
if(idElement==1){
document.getElementById('element'+idElement).innerHTML ='<a href="http://www.google.com">Google</a>';
} else if(idElement==2){
document.getElementById('element'+idElement).innerHTML ='<a href="http://woork.blogspot.com">Woork</a>';
}
}
</script>

<ul>
<li id="element1">Google</li>
<li id="element2">Woork</li>
</ul>
<a href="#" onClick="javascript:changeText(1)">Change Google into a link</a><br/>
<a href="#" onClick="javascript:changeText(2)">Change Woork into a link</a><br/>
Reactions:

0 comments:

Post a Comment

Leave a comment on blog quality.

Blogger

Related Posts Plugin for WordPress, Blogger...