Codepedia
.info
Home
About
Demos
Tools
SVG Wave Generator
Colors
Edit This Code :
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <style type="css"> #myTable td{padding:8px;} .btnSelect{background-color:#f44336;border:2px solid #f44336;border-radius:4px;color:white;cursor:pointer;} .btnSelect:hover{background-color:#c93326;border:2px solid #c93326;} </style> </head> <body> Enter Value :<input type="text" id="myTxt" /> <button id="btnSet">Set Value</button><br/> <div class="counter-animated" data-value="span dynamic value here"></div> <span id="my_IDLabel">100</span> <script type="text/javascript"> $(document).ready(function(){ $("#btnSet").on('click',function(e){ $("#my_IDLabel").text($("#myTxt").val()); var spanValue = $("#my_IDLabel").text(); $(".counter-animated").attr("data-value", spanValue) e.preventDefault(); }); }); </script>
➤ Run / View
Result :