Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to keep an html button pressed?

Tags:

I have a button <input type="button" name="name" value="value"/>. Is there any way to keep it visually pressed and unpress it via javascript?

Thanks

like image 245
gerarddp Avatar asked Jun 04 '11 17:06

gerarddp


People also ask

How do I keep a button pressed down in HTML?

You can use this document. getElementById("some_id"). style. border.

How do I anchor a button in HTML?

Using button tag inside <a> tag: This method create a button inside anchor tag. The anchor tag redirect the web page into the given location. Adding styles as button to a link: This method create a simple anchor tag link and then apply some CSS property to makes it like a button.

How do I make a button clicked by default in HTML?

In order to make it a button, change type="hidden" to type="button" . To make it invisible to the user, you could use inline styles like this: style="display: none;" . Show activity on this post. Trigger click event on the button as soon as document is ready.


1 Answers

I would try CSS and use the border-style inset, personally.

<input type="button" value="Inset Border" style="border-style:inset;" /> 

For a list of different styles, please see this jsFiddle.

like image 129
Brad Christie Avatar answered Sep 27 '22 18:09

Brad Christie