0

So I have figured out how to do this using AngularJS directive ng-show. Now I want to do it without using AngularJS but using something of HTML, CSS, Javascript. Is there any way to do it? I know of the display and visibility option but it uses on-click directive which I don’t intend to do. I want to set the class and behavior of the button based on some variable condition rather than on click.

To be precise this is what I want to do- So I want 2 buttons. One red and and one green. Only one of the two buttons will be displayed at a time on my web page. Which of the two buttons will be displayed will depend on my variable which will come from my database. So if the data that I extract from my database is 1 for e.g. then the green button will be displayed or vice-a-versa. So the green button needs to be disabled. Nothing happens when I click it, but the red button on click opens a new web page

SMG
  • 23
  • 8

0 Answers0