Answers for "how to store jquery function in variable"

1

jquery declare variable

var foo = 'some string';

// Popular pattern for variables that contains the result of a call in HTML:
var $foo = $('.foo'); // it's a valid name in jQuery
Posted by: Guest on March-06-2021
0

use jquery variable in html

<script>
   $(document).ready(function(){
      var inputvalue = "field 1";
      $('#id1').val(inputvalue);
   });
</script>

<html>
<body>
<div><input id="id1" value=""></div>
</body>
</html>
Posted by: Guest on April-09-2021

Code answers related to "how to store jquery function in variable"

Browse Popular Code Answers by Language