0

I would like for a tick to be shown and its opacity reduced on a button once it is clicked.

#btnTicketType{
    margin-bottom:2%;
    margin-top:10%;
    width:95%;
    height:15em;
    font-size:1.5em;
}

#seatnumber{
    display:block; 
    width:100%; 
    text-align:center;
    font-size:1em;
}

#rectangle{
    height:100%;
    width:100%;
    overflow:auto;
    outline-color:black;
    outline-style:solid;
}
<div id="rectangle">
        <div class="col-md-3">
            <button id="btnTicketType" class="btn btn-default">Button 1</button>
            <small id="seatnumber">Text 1</small>
        </div>
                <div class="col-md-3">
            <button id="btnTicketType" class="btn btn-default">Button 2</button>
            <small id="seatnumber">Text 2</small>
        </div>
                <div class="col-md-3">
            <button id="btnTicketType" class="btn btn-default">Button 3</button>
            <small id="seatnumber">Text 3</small>
        </div>
}
</div>
<br />

It would be nice if also to reduce the opacity of the button once the tick shows so that the tick would be more prominent for the user.

shikiko
  • 162
  • 1
  • 7
  • You should use an Element, besides a `` or ``, as buttons don't support `.innerHTML`. Either that or use `position:absolute;` on the button and the tick in and have the parent of the both, `position:relative;`. – StackSlave Nov 06 '17 at 02:19
  • 1
    Possible duplicate of [Change Button color onClick](https://stackoverflow.com/questions/26937424/change-button-color-onclick) – Chirag Jain Nov 06 '17 at 02:21
  • @PHPglue What does the question have to do with `innerHTML()`? A ` – Kirk Beard Nov 06 '17 at 02:21
  • You want a tick in the button. You cannot put anything in a button. – StackSlave Nov 06 '17 at 02:22
  • hmm, thanks chiru. I'll look into the link and see what i can do – shikiko Nov 06 '17 at 02:23
  • @PHPglue `` because a [buttons can have content](https://css-tricks.com/use-button-element/#article-header-id-1). So, based on that, you can add an `` tag inside a `
    – Kirk Beard Nov 06 '17 at 02:34
  • @shikiko I've posted an answer showing how to add elements to a ``. – Kirk Beard Nov 06 '17 at 03:39