What's New
Off Topix: Embrace the Unexpected in Every Discussion

Off Topix is a well established general discussion forum that originally opened to the public way back in 2009! We provide a laid back atmosphere and our members are down to earth. We have a ton of content and fresh stuff is constantly being added. We cover all sorts of topics, so there's bound to be something inside to pique your interest. We welcome anyone and everyone to register & become a member of our awesome community.

My code

Blake

Dedicated Member
Member
Joined
Nov 10, 2009
Posts
318
OT Bucks
656
What do you think of my JavaScript?

PHP Code:

PHP:
<script type=text/javascript>



var name=prompt(What is your wizards name?);

alert(hello  +name+  how are you today?);



var name1=promt(How are you today? answer with good or bad only);

if(name1=good)

{

alert(Thats good to hear);

}

else(name1=bad)

{

alert(Aww, sorry to hear)

}

</script>

What do you think? Dont know how to view?

Open notepad>copy and paste the code>save it with the extension .html>open a new tab in your broweser> got to file>open file> look for the file and BAM! Your done.
 
I would call name1 something different, just for clarity's sake. Also, you spelled prompt as promt. But that doesn't really matter...
 
DanteX said:
I would call name1 something different, just for clarity's sake. Also, you spelled prompt as promt. But that doesn't really matter...
What could i call it? This was my very first code
tongue.gif
 
I tried it out.. It doesn't allow you to answer How are you today?
 
Back
Top Bottom