A LemonadeJS self property can be bound to an HTML DOM element attribute, in this sense the attribute will be automatically updated when the self property value changes.

A working example

Source code

<script src=""></script>

<div id='root'></div>

var Lamp = (function() {
    var self = {
        state: 'off',

    var template = `
            <img src="{{'/templates/default/img/example-lamp-' + self.state + '.jpg'}}"><br/>
            <button onclick="self.state = 'on'">Light on</button>
            <button onclick="self.state = 'off'">Light off</button>

    return lemonade.element(template, self);

lemonade.render(Lamp, document.getElementById('root'));

See this example on codesandbox