Trying to set template font color based on msg.payload value

Hey guys,
I'm trying to set a font color in dashboard based on a value received in msg.payload. I've got the following code in the template node, but not having any luck:

<div>Status:<b style="color:blue;" id="status">Update</b></div>

<script>

function color() {
    if (document.getElementById("status"}.value === 'Update')) {
    document.getElementById("status").setAttribute("style", "color:lime;");
    }
};

</script>

In such case it should be as easy as adding this line in an empty the UI template node:

<div>Status:<b style="color:{{msg.payload}};" id="status">Update</b></div>

Flow:

[{"id":"a7d9890f.f7b6b8","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"3783949f.17df5c","type":"ui_template","z":"a7d9890f.f7b6b8","group":"6c31812f.dc347","name":"","order":0,"width":0,"height":0,"format":"<div>Status:<b style=\"color:{{msg.payload}};\" id=\"status\">Update</b></div>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":380,"y":120,"wires":[[]]},{"id":"467cb421.afb8cc","type":"inject","z":"a7d9890f.f7b6b8","name":"","topic":"","payload":"blue","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":120,"wires":[["3783949f.17df5c"]]},{"id":"c1383201.f8bff","type":"inject","z":"a7d9890f.f7b6b8","name":"","topic":"","payload":"lime","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":180,"wires":[["3783949f.17df5c"]]},{"id":"6c31812f.dc347","type":"ui_group","z":"","name":"G1","tab":"2c679adf.6ce5a6","disp":true,"width":"6","collapse":false},{"id":"2c679adf.6ce5a6","type":"ui_tab","z":"","name":"TAB1","icon":"dashboard"}]