Sweet Alerts – Replacement of Javascript Alert Function

A beautiful replacement for  javascript’s “ALERT” is Sweet Alert( a.k.a Swal)

Sweet Alert is a responsive alert which automatically centers itself

on the page and looks great no matter if you’re using a desktop computer, mobile or tablet.

It’s even highly customizeable.

You just need to include 1 JS file and 1 CSS file for Sweet Alert i.e.

<script src="./js/sweet-alert.min.js"></script>
<link rel="stylesheet" href="./css/sweet-alert.css">

To call the sweetAlert-function you just need to do following:
   title: "Error!",
   text: "Here's my error message!",
   type: "error",
   confirmButtonText: "Cool" 

It is highly customize-able to get rid out of alert().

For downloading needed JS and CSS and documentation you can visit:
Sweet Alert Website

Submit Form On Press Of Enter Key

To submit HTML form by pressing ENTER key you can use following:

<form action="search.php" method="post">
<input id="searchVal" name="search" type="search" placeholder="Search Here..." 
onkeydown="if (event.keyCode == 13) document.getElementById('btnSearch').click()" />
<input id="btnSearch" class="btn btn-primary" type="button" value="Search" />