gareth2 Posted December 21, 2006 Share Posted December 21, 2006 could some one tell me what is wrong with this.[code]<p align=center id=message_0 style=visibility:hidden>You attack $stat1[user] for $stat[att].</p><script>var message_0 = document.getElementById(message_0);window.setTimeout(message_0.style.visibility='visible', 100);</script>[/code] Quote Link to comment Share on other sites More sharing options...
darrin365 Posted December 21, 2006 Share Posted December 21, 2006 I am by no means and expert, so take this with a grain of salt, but on the HTML side of things "align" is a deprecated attribute with regard to the <p> tags. You also should have id="message_0" and style="visibility:hidden" (if your intention is for the latter to be a CSS style). Quote Link to comment Share on other sites More sharing options...
obsidian Posted December 21, 2006 Share Posted December 21, 2006 darrin365 is on the right track. Your main issue is that within your getElementById() function call, you must have the id name within quotes. In addition, you really need to clean up your markup, or you'll have all sorts of issues in the long run. Also, your setTimeout function accepts a [b]string[/b] as the first parameter, not straight code. So, you need to either write a function that will show what you're after, and call that function, or you need to encapsulate your script to run within quotes:[code]<p align="center" id="message_0 " style="visibility:hidden;">You attack $stat1[user] for $stat[att].</p><script type="text/javascript">function showDiv(id) { var myDiv = document.getElementById(id); myDiv.style.visibility = 'visible';}window.setTimeout('showDiv("message_0")', 100);</script>[/code]Good luck. Quote Link to comment Share on other sites More sharing options...
artacus Posted December 21, 2006 Share Posted December 21, 2006 PS: Please use descriptive titles in the future. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.