473,378 Members | 1,236 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to make disappear a button in HTML ?

It is possible to make a button invisible or hide by -
Expand|Select|Wrap|Line Numbers
  1. $('#ButtonID').hide();  document.getElementById('ButtonID').style.visibility = 'hidden';
But the button is still show in form. I need to know how to make it disappear?
Sep 25 '13 #1
2 7293
Nepomuk
3,112 Expert 2GB
As far as I can tell, that should work; I just built this short example which does.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
  2. <html>
  3.     <head>
  4.         <title>visibility</title>
  5.         <script type="text/javascript">
  6.             function onoff () {
  7.                 if (document.getElementById)
  8.                     document.getElementById("buttonId").style.visibility = "hidden";
  9.             }
  10.         </script>
  11.     </head>
  12.     <body>
  13.         <input type="button" id="buttonId" value="Button"/>
  14.         <p>
  15.             <a href="javascript:onoff()">Hide button</a>
  16.         </p>
  17.     </body>
  18. </html>
Sep 25 '13 #2
Exequiel
288 256MB
I code for some hiding elements using jquery. . :)
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
  2. <html>
  3.  <title>Zick Hide</title>
  4. <head>
  5. <style>
  6. body{padding:0; margin:0;}
  7. </style>
  8. <script type="text/javascript" src="jquery-latest.min.js"></script>
  9. <script type="text/javascript">
  10. jQuery(document).ready(function(){
  11.     $("#hide_btn2").click(function(){
  12.         //$(this).hide("slow");
  13.         $(this).fadeOut("slow");
  14.     });
  15.  
  16.     $("#button_hider").click(function(){
  17.         $("h2").toggle("slow");
  18.     });
  19.  
  20. });
  21. </script>
  22. </head>
  23. <body>
  24.     <div align="center">
  25.         <h3>Jquery</h3>
  26.         <button id="hide_btn2">Hide me</button>
  27.         <br><br>
  28.         <h2 style="background:#006666; padding: 10px; width: 300px;">HIDE ME IAm H2</h2>
  29.         <button id="button_hider">Hide H2</button>
  30.     </div>
  31. </body>
  32. </html>
Its more easy and less codes if you will use jquery for that kind of situition, there are lots of tutorials for jquery in google and youtube, just search jquery. . :)
Sep 26 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: AaaaM | last post by:
how can i make a button the default so if the user push the enter button it is handled?
4
by: Lau Alvin | last post by:
HI all , I want to make a button which have a server side OnClick event in .cs to update the DB. But I want it to have a client side onclick event to run a javascript popup too. And the...
5
by: Asha | last post by:
hello i'm doing this protected static System.Web.UI.WebControls.Button btnExcel; hoping that it would remain shared but when i run the application i get this error Compiler Error Message:...
0
by: John Smith | last post by:
How to make link button in a data grid non hyperlink at runtime. Depending upon the data in the cell I would like to make it hyper link or non-hyper link. I am reading the data in the item data...
1
by: scolivas | last post by:
I want to make a button that will open a specific file folder that contains some crystal reports. I don't want to pick a report ...just want to "lead the user to the folder" with just a click... ...
4
by: Franky | last post by:
I know about EnableWindow(GetDlgItem( hDlg, IDCANCEL), FALSE ) which will gray a button in a dialog box. But I want to make the button and some text to not show at all in one instance. ...
1
by: mdburton | last post by:
onclick="this.href='javascript:void(0)';this.disabled=1"> ive tried that, but it renders it useless and doesnt make it 'submit' it should be able to work, but so the user cannot submit it twice...
3
by: shimajavar | last post by:
Hi all I have the following code: a line is growing up by clicking on "up" button, it has another button"start" which I want it to stop the process of growing the line...How can I make a button to...
5
by: Susan Bricker | last post by:
I have a command button that I'd like to make "disappear" after being clicked and after the OnClick function has executed. I have tried changing the 'visible' attribute to false while within the...
2
by: tvnaidu | last post by:
I am looking for status button html code, should be in a rectangle box, one is ON and other one is OFF, red color for OFF and Green for ON. status depends on a variable called "stat_var", if it is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.