How To Add JavaScript Popup Boxes to Blogger

Posted by Lasantha Bandara on September 26th, 2009 File Under : java script0 Comment

Use below codes to add Popup Boxes to your blog post or as a page element.

Alert Box

Code:

<script type="text/javascript">function show_alert(){alert("YOUR MESSAGE HERE!")}</script><input type="button"onclick="show_alert()"value="Show alert box"/>

Result:

Confirm Box

Code:

<script type="text/javascript">function show_confirm(){confirm("YOUR MESSAGE HERE!")}</script><input type="button"onclick="show_confirm()"value="Show confirm box"/>

Result:

Prompt Box

Code:

<script type="text/javascript">function show_prompt(){prompt("YOUR MESSAGE HERE!","")}</script><input type="button"onclick="show_prompt()"value="Show prompt box"/>

Result:

File Under : java script

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.