JavaScript: Div & Element hide & show cross-browser script solution
Hello Guys,
Today I was working in a project where I had to add element hide and show depending on the condition. For example, if the client wants to contact by phone, the phone DIV element or area appears. If not, the phone DIV element hide quickly. I was writing scripts for this. But to my surprise, I noticed that none of them are cross-browser supporting. When one scripting working in few browsers, the same script is not working in other browsers. So, I struggled to come up with the cross-browser solution and at last, I succeeded. You can use this code in your form whenever you need to show and hide elements dynamically in JavaScript. This script is a kind of Contact Us form.
So, what am I gonna do? I am going to share my small script so that you can save your time I you find my this article by Google search or any other search.
OK!
No more introduction. Let us start.
Download:
I suggest you first download the script and take a look.
http://www.tanzilo.com/demo/code/hide_show/hide_show.zip
Features:
- It is a totally CSS-based and table-less scripting
- I have used phpMailer version 2.3 and it works for PHP 5 and/or 6 version
- JavaScript used as you already know
CSS Code:
{code type=CSS}
{/code}
HTML Code:
{code type=HTML}