I am trying to set text on button depending on condition. If condition is true, Hello text should be displayed within button, otherwise - Goodbye. This is what I tried. Here is my component:

<button onClick="changeItemStatus('{!$Component.bVAL}', '{!item.Id}'); return false;" style="{!IF(orders[item.Id] > 0, '???', '???')}">Hello</button>

And this is what I want to use instead first ??? (if the condition is true):

button:after {

Or maybe here is another way to solve this. Thank you


I wouldn't use CSS to do this, I'd just change the value in the content of the button:

<button onClick="changeItemStatus('{!$Component.bVAL}', '{!item.Id}'); return false;" >{!IF(orders[item.Id] > 0, 'Hello', 'Goodbye')}</button>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.