Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
101
rated 0 times [  105] [ 4]  / answers: 1 / hits: 76321  / 15 Years ago, mon, november 9, 2009, 12:00:00

I have an html page which has a link called open. Once the link is clicked the text open should change to close. How do I do this?


More From » html

 Answers
28

Script



<html>
<head>
<script type=text/javascript>
function open_fun() {
document.getElementById('link').innerHTML = <a href='javascript:clo_fun()'>CLOSE</a>;
}
function clo_fun() {
document.getElementById('link').innerHTML = <a href='javascript:open_fun()'>OPEN</a>;
}
</script>
</head>
<body>
<div id='link'><a href='javascript:open_fun()'>OPEN</a></div>
</body>
</html>

[#98358] Thursday, November 5, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nestorjarettg

Total Points: 451
Total Questions: 108
Total Answers: 108

Location: Rwanda
Member since Thu, Feb 10, 2022
2 Years ago
;