Disable attribute in HTML elements

LemonadeJS provides a simple way to control the disabled property of HTML elements.

Example


See this example on jsfiddle


Source code

<html>
<script src="https://lemonadejs.net/lemonade.js"></script>
<div id='root'></div>
<script>
function App() {
  const self = this;
  self.disabled = true;
  return `<>
        <button onclick="self.disabled = !self.disabled">{{!self.disabled?'Disable':'Enabled'}}</button>
        <input type="text" disabled="{{self.disabled}}" value="test..." />
    </>`;
}
lemonade.render(App, document.getElementById('root'));
</script>
</html>