Forum Moderators: open
This is my first post. My name is Sam. I read around the website and i got some good help on this but im still lost in something i cant manage to figure out.
How do you make a paragraph expandable/collapsable using a hyperlink in the end that changes with the state of the paragraph (expanded vs collapsed)
Take this a visual example of what i mean:
State1
This is a test paragraph in which if you click[expand]
(once u click the hyperlink "expand post" it will change to State2)
State2
This is a test paragraph in which if you click on the expand hyperlink it will become a full paragrah [Collapse]
(once u click the hyper link "collapse" it will go back to the State1)
Thanks you for the help...
Sam
// the following function's taken from QuirksMode website
function getObj(name) {
var o = 'this.obj = document.';
var s = 'this.style = document.';
if (document.getElementById) {
eval(o + 'getElementById(name);');
eval(s + 'getElementById(name).style;');
}
else if (document.all) {
eval(o + 'all[name];');
eval(s + 'all[name].style;');
}
else if (document.layers) {
eval(o + 'layers[name];');
eval(s + 'layers[name];');
}
}
//-->
</script>
</head>
<body>
<p id="templ">This is a test paragraph in which if you click[expand] (<a href="javascript:void(0)" onclick="change()">once u click the hyperlink "expand post" it will change to State2)</a></p>
</body>