...

View Full Version : FAQ code issues



phqsteele
05-29-2012, 09:37 AM
Hi, Im trying to create an FAQ. I have this code which works. I have worked out how to change the font/colour eetc of the link you click on to reveal and hide the text, but I cant work out how to
1. change the font, size etc of the revealling text.
2. Include a text link in the revealing text.

If anyone could help me that would be amazing, I'm new to this and have spent ages trying to figure it out!

Thanks

code:


<a><font><font><html>
<head>
<script type="text/javascript">
function toggle(obj) {
var obj=document.getElementById(obj);
if (obj.style.display == "block") obj.style.display = "none";
else obj.style.display = "block";
}
</script>
</head>
<body>
<a href="javascript: void(0);" onClick="toggle('q1')"<p>
<font color="#000000"; face="helvetica"; font size="3">Question1</a>
<div id="q1"
<div id="q2" style=>The answer</div>
</body>
<br>
<head>
<script type="text/javascript">
function toggle(obj) {
var obj=document.getElementById(obj);
if (obj.style.display == "block") obj.style.display = "none";
else obj.style.display = "block";
}
</script>
</head>
<body>
<a href="javascript: void(0);" onClick="toggle('q2')">Question 1</a>
<div id="q2" style=>The answer</div>
</body>
<br>
<head>
<script type="text/javascript">
function toggle(obj) {
var obj=document.getElementById(obj);
if (obj.style.display == "block") obj.style.display = "none";
else obj.style.display = "block";
}
</script>
</head>
<body>
<a href="javascript: void(0);" onClick="toggle('q3')">Question 1</a>
<div id="q3" style="display:none;">The answer</div>
</body>
<br>
<head>
<script type="text/javascript">
function toggle(obj) {
var obj=document.getElementById(obj);
if (obj.style.display == "block") obj.style.display = "none";
else obj.style.display = "block";
}
</script>
</head>
<body>
<a href="javascript: void(0);" onClick="toggle('q3')">Question 1</a>
<div id="q3" style="display:none;">The answer</div>
</body>
<br>
<head>
<script type="text/javascript">
function toggle(obj) {
var obj=document.getElementById(obj);
if (obj.style.display == "block") obj.style.display = "none";
else obj.style.display = "block";
}
</script>
</head>
<body>
<a href="javascript: void(0);" onClick="toggle('q2')">Question 1</a>
<div id="q2" style="display:none;">The answer</div>
</body>
</html></br></br></br></br></font></font></font></a>

phqsteele
05-29-2012, 05:38 PM
anyone? :confused:
I'm sure its something relatively simple..

Major Payne
05-30-2012, 02:53 PM
Try validating and correcting your code first. Not sure why you have multiple body tags, etc..

Validating:

Why Validate?: http://validator.w3.org/docs/why.html
CSS Validator: http://jigsaw.w3.org/css-validator/
HTML Validator: http://validator.w3.org/#validate_by_uri+with_options



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum