Hi,
I have a node red template with html to show some payloads on a screen.
like:
<div style="font-family:direction; color:{{msg.payload.bits.toString(2)[31]==1 ? 'red' : 'white'}};">H</div>
The letter H is in collor red or white depending on the value msg.payload.bits.toString(2)[31]
That is working fine.
I made already:
<div style="font-family:direction ">{{msg.payload.bits.toString(2)[30]==1 ? "A" : " "}}{msg.payload.bits.toString(2)[29]==1 ? "J" : " "}}</div>
With bit30, I have “A” or space on screen or with bit29, I get “J” or space on screen…
We can’t have both at the same time.
Now I like to have the letter “A” depending of msg.payload.bits.toString(2)[30] in red or white color
or
the letter “J” depending of msg.payload.bits.toString(2)[29] in blue or white colorJ
I’am new in html-javascript and don’t know how to fix it.