Can someone please tell me how I can hide this button after pressing it using jQuery?
<input type="button" name="Comanda" value="Comanda" id="Comanda" data-clicked="unclicked" />
Or this one:
<input type=submit name="Vizualizeaza" value="Vizualizeaza">
jQuery offers the .hide() method for this purpose. Simply select the element of your choice and call this method afterward. For example:
One can also determine how fast the transition runs by providing a duration parameter in miliseconds or string (possible values being 'fast', and 'slow'):
In case you want to do something just after the element hid, you must provide a callback as a parameter too:
Try this:
For doing everything else you can use something like this one:
For hidding any other elements based on their IDs, use this one:
You can use the
.hide()
function bound to aclick
handler:It depends on the jQuery selector that you use. Since
id
should be unique within the DOM, the first one would be simple:The second one might require something more, depending on the other elements and how to uniquely identify it. If the
name
of that particularinput
is unique, then this would work: