Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
-----
<html->
<head->
<script- type="text/javascript">

<-/script->



<button- type="submit" onClick() >Button1 <-/button->


<button- type="submit" >Button2 <-/button->

What I have tried:

how can hidden button 2 when i click button 1
by javascript
Posted
Updated 15-Apr-17 3:10am
Comments
Nick_3141592654 15-Apr-17 5:10am    
You need to fill in the "What I have tried" section with some information (not a re-statement of your question) after you have actually tried something.

I think you've closed your eyes and wished really hard, which, sadly, is not how software is created.
Member 12695679 15-Apr-17 5:57am    
My question is very simple
if you not understand please do not replay

1 solution

<big>//your html code should be like below</big>

<button id="btn1" type="submit" onclick="hideButton()" >Button1 </button>
<button id="btn2" type="submit" >Button2 </button>


//javascript function should be like this

function hideButton()
{
  alert();
  document.getElementById('btn2').style.visibility = 'hidden';
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900