开发者

Javascript to add output to div

开发者 https://www.devze.com 2023-01-28 19:08 出处:网络
Alright, I have some javascript that pull the input from a form input (no submit button is used). <scri开发者_开发百科pt type=\"text/javascript\">

Alright, I have some javascript that pull the input from a form input (no submit button is used).

<scri开发者_开发百科pt type="text/javascript">
$("input#level").keyup(function () {
  var value = $(this).val();
  $("span#level-text").text(value);
}).keyup();

This then adds the content into a span clan. I would love to take this input and then add it to another div (#test). I guess I basically need to take two numbers (two different inputs), and add them together and have the new added number out put to another div (all without a submit)


Assuming you are asking to take two inputs place each those values in a span and also add their values together in another div. You would do something like this: JSFiddle Example

0

精彩评论

暂无评论...
验证码 换一张
取 消