skip to Main Content

I am creating an app in django and I have the next problem: I want to add a glyphicon into the next button:

<input class="btn btn-primary" type=button name="name" onClick="location.href='/location/'" value='I am a button'>

Concretely, I want the glyphicon to be with the text ‘I am a button’. How can I do it?

Thank you!!!

2

Answers


  1. add the class as the icon class. For example class="glyphicon glyphicon-off for power button. Moreover remove the value of the button.

    Login or Signup to reply.
  2. instead of using input type button, you should try using button element
    so something like this

    <button type="button" class="btn btn-primary"  onClick="location.href='/location/'">
       <span class="glyphicon glyphicon-music"></span> I am a button 
    </button>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search