This is a simple cross-browser snippet to open an e-mail message window onclick of a button using JavaScript, in some scenarios you might want to open up an e-mail message window when user clicks on a button, yeah this is possible with a simple snippet code which can be included in your onclick event.
Below is the respective cross-browser code for the same:
1 2 3 4 5 6 7 8 9 10 11 12 13 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <form name="emailwindow"> <input type="button" value="Mail Me at vivek@developersnippets.com" onclick="self.location='vivek@developersnippets.com'" /> </form> </body> </html> |
Even the above can be placed in a function and can be called the same when user clicks on a button. This is simple but very powerful as this can be used a cross-browser snippet.
1 2 3 4 | function emailwindow() { self.location='vivek@developersnippets.com'; } |
Related Entries...
The above title of the article comprises that whether your website uses the best doctype while develo ...
There might be some scenarios where we need to check whether a particular DIV is visible or not and i ...
In the following article we can have a look at the ways of creating new files in Ruby programming lan ...
Below script will lets you to open Ext.Panel (that is Panel) onClick of an anchor link. Its really a ...
Here is a simple snippet on adding a "div" to the body tag dynamically using JavaScript, after going ...
Introduction: This is one of the good example on how we can load a ThickBox (Example: ThickBox relat ...
To start with, Well I think bunch of developers might have come across this situations where in which ...
Introduction Below is the simple snippet which allows us to show or hide the Ext.Window panel, on bu ...
Introduction This post help beginners to learn and implement some jQuery Web Applications. Develop S ...
Introduction: After going through this article, you can be able to develop a simple slide panel appl ...























2 Responses
I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.
Yes! thought your post is a very interesting + informative !