How to change the text on a button progamatically? |
I'm not familiar with CodeIgniter Simplicity, so I'm not sure where it's going wrong.
If you choose to store the active campaign in a session variable, you can stick with the old code you had, and set the text of the red button accordingly. PHP Code: <button id="myCamp" class="btn pull-right btn-danger navbar-btn">Active Campaign: <?= $this->session->campaign;?></button> If you don't want to use a button, you should use css to style the element. One way is by using class names (like Bootstrap is doing for a lot of elements). Another way is setting the style attribute of the element. Example: PHP Code: <div style="background-color: black; color: white; padding: 12px; font-size: 20pt; font-weight: bolder;"> A good tutorial about css: https://www.w3schools.com/css/ |
Welcome Guest, Not a member yet? Register Sign In |