WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You

WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Rejected Adding A JavaScript Button Sun May 16, 2010 11:00 pm

Krazy


Registered Member
Registered Member
Okay WebArtz Members,

To start off, I will show you the full code we will be making.

Code:
<html>
<head>
<script>
function myfunction()
{
alert("This Is Krazy's Tutorial");
}
</script>
</head>

<body>
<form name="myform">
<input type="button" value="Click Me" onclick="myfunction()">
</form>
</body>
</html>
To View An Example, Please Visit Here

Now I will explain the code.

  • alert("This Is Krazy's Tutorial");

    What I have bolded above can be edited. Where it says alert, You can put one of the three ones I list below.
    • Alert
    • Confirm
    • Prompt


  • Now, Inside the (""). In between the "" you can put whatever text you like.

________________________________
Now I will explain the last part of the code.

  • <input type="button" value="Click Me" onclick="myfunction()">
  • What I have bolded above is the name that will show on the button. You may edit that to whatever you like.

_________________________

Thank you for viewing my tutorial. This was all written by me; Sanket if I need to add anything else let me know.

2Rejected Re: Adding A JavaScript Button Thu May 20, 2010 5:55 pm

Joel

Joel
Registered Member
Registered Member
great tutorial Krazy! I only saw the example, did'nt actually test out the codes. I'm sure this will get accepted! All the best!

http://www.advertisehotspot.info/

3Rejected Re: Adding A JavaScript Button Thu May 20, 2010 6:50 pm

ankillien

ankillien
Administrator
Administrator
Hi Krazy,
Thanks for your contribution.

I think the tutorial is not perfect, I think. This is not the best way to show an alert box on button click. Only one line code would do this trick.
The code you use is too much long and unnecessary.

You can resubmit this tut with simpler and better code and explanation.

Thanks Very Happy

Tutorial Rejected

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum