Below given are 10 very basic, yet useful and handy snippets, which can help you achieve certain basic features for your website.
Instructions to implement the snippets:
- Put the code labeled as Script in the head section of your web document, i.e. below <head> and above </head> tag.
- Put the code labeled as Markup in anywhere in the body section of your web document, i.e. below <body> and above </body>.
E-mail Validation Script:
<form onSubmit="return validateEmail(this);" action=""> E-mail Address: <input type="text" name="emailid" /> <input type="submit" value="Submit" /> <input type="reset" value="Reset" /> </form>
Comma Separator Script:
Disable right-click Script:
Disable text selection Script:
Random quotes Script:
Formatted date Script:
Search box effect Script:
<input type="text" value="Search..." onfocus="if(this.value=='Search...') this.value='';" onblur="if(this.value=='') this.value='Search...';" />
Add to Bookmark Link:
If you have any queries about the above given scripts, feel free to reply back with it in comments. I hope you enjoyed these snippets, have a good time.