<script type="text/javascript" src="http://devote.github.io/files/letjs/let.js"></script> <script type="text/javascript"> letJS.setHandler("data-let-pattern", function(rules) { var elem = document.querySelector(rules.rule); var value = elem && +(elem.value || elem.textContent || elem.innerHTML); return !elem || +rules.expectedValue <= value; }); </script> <div id="count">44</div> <input type="text" data-let-pattern="#count" /> <br/><button onclick="var a = +prompt('Введи число'); document.querySelector('#count').innerHTML=a;">Изменить паттерн</button>